When can you prepare a recently casted spell?

The Pathfinder rules for divine spellcasting state that:

at the time of preparation any spells cast within the previous 8 hours count against the number of spells that can be prepared.

But does that mean that you lose a spell slot for that day, or can you use an extra session of preparation to prepare a spell in that slot, once enough time has passed?

For example, my cleric got ambushed midnight and burned the 3rd-level domain slot. He can’t prepare another 3-level domain spell on his preparation session on the morning, 4h after casting the spell.
But can he prepare a spell un that slot with an extra session once the full 8h have elapsed, or must he wait until the next morning and preparation session?