It's happened twice so far that after a hero (or at the first time, two heroes) died in battle and I put them back, my ap is suddenly higher. Both times I had done nothing with my units but let them heal (no change of gear at all).
I only even noticed because in both cases, I suddenly was above ap cap. First time, I was at 2075 before and then suddenly had 2079. Second time I had 2076 exactly, after a hero died and I put her back it is 2081.
I have screenshots of the after, but apart from showing the higher numbers in red they probably won't help (I'll put them anyway if you like).
No I did not unequip and reequip all my units to see if it goes back to normal – too much gear to be sure I pick the same things second time round. I did try to follow the math and found something else though, but that's a separate post.