Greece income bug - Allied vs. Mercenary

The summary is, when I purchase an allied unit that costs, say, 20, it does subtract 20, but I must have 40 available, or I get the insufficient income error. During my struggles in the Ionian War to weaken the Athenian economy, I consistently find myself bumping against my income.

Let's assume I have 55 income leftover after paying ongoing expenses, enough to recruit a Spartan Hoplite brigade costing 50, which I am able to do just fine since it's one of my native units. Additionally, I can correctly recruit and pay for the costs on mercenary units. I don't have enough to hire Hoplite mercenaries since the 35 gold doubles to 70, but I can recruit Peltast mercenaries fine at 40 after it's been doubled...

But, the same doubling cost also applies to Allied units with respect building them (excluding triremes and workers). At 55 gold leftover, I can recruit one allied Peltasts which cost 20 gold normally, but no more than one because I have 35 afterward, which is below double the 20, or 40.