Two masses orbiting their common center of gravity are undergoing centripetal acceleration, so they continuously emit gravitational waves, spiraling closer as they lose energy (that's how the emission of gravitational waves was originally confirmed [1]).
[1] https://www.nobelprize.org/nobel_prizes/physics/laureates/19...
Where did the photons "come from"? Well, they weren't stored "inside" the electrons. By what process were the photons generated? Electrons accelerating radiate. That's essentially the answer. You can "math it up" if you want. It's not exactly an axiom, but it's pretty close to the bottom.
No, it's the other way around. The warping is due to the mass
But the other answer hinted at the source: accelerating mass turns into gravitational waves as an accelerating electron turns into EM waves (remember rotation and things stopping abruptly also means acceleration)
So yeah, it's the potential energy that turns into (less than Newtonian amounts of) kinetic energy because some of it is turning into Gravitational waves
And you can imagine something as big as black holes spinning around each other at a frequency measurable in Hz how much energy they can give in that process then add the sudden merger deceleration.