The overage cost doesn't go to the next spy like overage research goes to the next in that tree. It just goes right into the treasury.
Then again, the refund may have happened after criticism about the loss of the money...so after people saw it happen when this espionage system was first put in place and spoke up, perhaps SD changed it.
When I remembered about the overage refund, I checked it against my most current guestimit on spy costs. I had 107bc for the first spy after 3 trials. This 4th trial employing the refund idea had a cost allocation of 154bc and lets say the treasury was 1000bc with a expected gain of 100bc and all population growth had halted, trade routes blocked and influence lines didn't swagger and no econ treaties employed, no research going on (completely level economy income).... The following week instead of the 1100bc expected, I had 1154bc. So if the cost for the first spy is 100bc then I had overspent by 54bc and it was refunded to me.