ROTS was always written to only take place over about a week.
The novelization of the film gave it a 2-3 month period.
But let’s say it always was supposed to be 3-10 days. Padme really didn’t tell Anakin for 8-9 months that she was pregnant? The way they talk about “going early to naboo to get the baby’s room ready” is not what someone who’s giving birth in two weeks would say. It just doesn’t work based on how pregnancy maps out.
I don’t remember that being part of the novelization.
Anakin’s been gone for months on the Outer Rim sieges. The passage of time is actually very easy to track in the film, it’s only a few days. I think we are meant to believe that the delivery is premature because Padme is dying (“We have to operate quickly if we are to save the twins”).