I was having troubles with the enclosure on Raspberry Pi 5. I've found a thread about firmware upgrade fixing it for an Ugreen enclosure raspberrypi/linux#7080
I gave this repo a chance and it works with my cheap enclosure having factory firmware version 1.23 . After upgrade to 1.34 it fixed the initial issue.