If you insert the full panic message into the forum's Additional Text tool, we might be able to help you diagnose the cause of this kernel panic.
In the mean time, on an M4 Mac, this can be triggered when the WindowServer becomes unresponsive for too long, usually because the CPU or GPU is stuck waiting on a resource or driver operation. Typical causes include graphics driver issues, or bad third-party software that hooks into the GUI.
Another common cause is hardware-level contention — for example, a buggy display configuration (external monitor via USB-C/Thunderbolt), bad cable or hub, or VRAM pressure when using multiple high-resolution displays. Sometimes, background processes like loginwindow or accessibility services can indirectly cause WindowServer to hang if they flood the system with requests. Less commonly, a corrupt user preferences file (especially com.apple.windowserver.plist) or launch agent can cause similar timeouts.
Since you just purchased this laptop, I suggest that you contact Apple Support directly for further advice on your next steps.