Bug found: If an allied nation’s unit is positioned over a harbor, and that harbor is the city’s only spot to spawn a naval unit, the game still allows the purchase. However, the purchased unit never appears, and the gold spent is lost.
I found the bug while waging war with a neighboring nation when my ally had a scout over my harbor.