Macbook Pro cannot automatically detect external monitor automatically after I unplug external monitor when it is sleeping
I have the same behaviour with exception of the Automatic reboot (it does not do that).

I explain it this way.

When going to sleep mode Mac will create a Sleep image of the system status/configuration.

It is not monitoring the external devices during the sleep.

If you disconnect the monitor during the sleep it will not know that.

When it wakes up it will load the sleep image containing the system profile and is looking for the monitor and can not find it.

So far everything is normal.

I do not know why does it reboot on Mirror Display? For that please provide the Console log at that time stamp so we can look ofr the reason.