Debian 13 reboots randomly when WD Elements external drive is connected

There is HP Elitedesk G5 Mini running Debian 13, kernel 6.12.95. When an external drive WD Elements 8Tb is connected to USB, the HP reboots randomly – usually in about 5-10 minutes.

The drive has external power source. The drive is XFS-formatted. Reboots happen even if the drive is not mounted. There are no kernel panic or any other suspicious log messages before it reboots. If the WD drive us not plugged into USB, the HP works fine.

I performed XFS filesystem check, tried another USB port, used GRUB_CMDLINE_LINUX_DEFAULT="quiet usb-storage.quirks=1058:25a3:u" to disable UAS in favor of usb-storage, but nothing helps.

Any ideas what might be wrong and how to handle it?