Since the same Apple Account works normally on the M4, I wouldn’t assume iCloud itself is the cause. The timing after signing in may just be exposing something specific to the M5 Mac.
I’d run Apple Diagnostics on the M5 first. Shut it down, then hold the power button until startup options appear and press Command-D. Apple Diagnostics can check for hardware issues, including wireless hardware.
If Diagnostics reports no problem, I’d also test the Mac in Safe Mode. If Wi-Fi and Bluetooth remain stable there, that would help narrow this down to software rather than hardware.
Since both Wi-Fi and Bluetooth are dropping, I’d avoid deleting network settings or making larger iCloud changes until you know whether Diagnostics finds anything.
A friendly note: This is the German-language Apple Support Community. Posting your question in German will make it easier for more members to understand it and offer assistance.