Maybe she closed it because of the twins. Maybe she panicked as seen in that state by others moments later. As this case obviously lacks witnesses (Madeleine last seen at 17:30 by an independent witness) it was always going to rely on circumstantial evidence to solve it.
Madeleine may very well have been seen being carried from the apartment at around 9.15pm. Had the witness enjoyed the same benefit of hindsight of which many aficionados of Madeleine's case appear to have an expertise, she would have screamed for assistance from Jerry, who she had just passed and given pursuit herself.
Not having advantage of prescience and despite the sighting giving her pause for thought she continued on her way entirely unaware of the significance of what she had seen. Had she been a couple of minutes earlier and was able to view the whole scenario of the unknown child carrier leaving the environs of block five and being close enough to recognise the child being carried, that would probably have put an entirely different complexion on the event ... and you and I would not have been having this conversation.