I’m noticing that every single time I wake my (recent) MacBook from sleep, it forgets it’s attached to external monitors for at least 10 seconds. So, a bunch of windows do this confusing jump around and I have to wait for them to settle before I started anything!
It depends on how long that external monitor takes to wake up and respond to the display connection to confirm that it is there. If the monitor is still active then that is almost instant.