Bonus Kbase Article of the Week: If You See ‘Disk Not Ejected Properly’ on Your Mac Pro (2023) →

Apple Support:

Certain models of internal SATA drives might unexpectedly disconnect from your computer after your Mac wakes from sleep. This can occur if your Mac automatically goes to sleep or if you manually put your Mac to sleep. If you see a message that your disk was not ejected properly, you can restart your Mac to reconnect to the drive.

Apple is aware of this issue and resolution is planned for a future macOS update.

To avoid the bug, Apple recommends turning on the “Prevent automatic sleeping when the display is off” option in System Settings.

via MacRumors Joe