Suppose there are two slopes. Imagine its just small slope and can be placed on your floor. One slope is made of a very smooth material and another which provides a lot of friction for example made of rubber. Now you place a cubical metal block on each of the slopes. Both the blocks are exactly identical. The metal block on the smooth surface will slide down due to the action of gravity but the one place on the rubber slope will not. Where did the rubber slope get energy from to work against the action of gravity and holding the block in its position?
Energy is associated with work not with force as work energy theorem states. In other words, force can be exerted without generating any work, in such a case whatever exerted the force doesn't lose or gain any energy because no work was done.
In your example, the rubber slope exerted force (friction force) but no work was done (the metal block didn't move). So there is no exchange of energy although force is exerted. Think of the force in this case as energy-free action. The energy of the slope has nothing to do with the gravitational potential energy of the metal block