Don't know if this has happened to anyone but as Maratha I was "funding" the Ottoman's war with...basically the rest of the world. After each turn I'd give whatever cash I had left over to them. It ranged from 2k to 30k.

I was never allied with them, just peace and a trade agreement.

Then one day they declared war on me :(