Did you read what I tried to explain to you?
Not necessarily, your power output on a 12% will not be the same than your power output on a 5%, assuming the same heart rate of, for argument's sake, 170 bpm. It will depend on several characteristics such as kinetic energy of wheels and characteristics of riders.
Another example: on a 12% slope the effect of
standing up (another factor) has a less aerodynamic impact than when riding 25 kmh on a 5% slope. Different muscles are used, and some people might be more efficient on gentler slopes while some of us are more efficient at 7%. Again, power output is not the same at the same heart rate!
Another example: on a steel slope cooling effect by air on the body is decreased, therefore, your body needs to waste some energy dissipating heat which is deducted from your biomechanic efficiency.
Since I am assuming you didn't understand a single word of the examples I gave you, forget about physics, just go and try it by yourself!

cycling is a fun sport...