SPOILER! Kattints ide a szöveg elolvasásához!First, you said that you have HDD enclosure, but didn't say what kind of HDD did you put in. If it is a SSD, then it could be fine, SSDs have very reasonable power consumption. But if it is some SATA 2.5" HDD from old laptop surplus, they can suck a spike of 1.5-1.8 A from VBUS when spinning up. The USB-SATA electronics is pretty sensitive to power deficiencies, and, even if connected and enumerated, it may not read all drive capabilities and tables, and the device won't appear as a valid system device. In many cases the HDD cycles up and down for some time.
When you connect the HDD enclosure directly to a host with a shorter cable, the voltage drop is likely small, and the HDD powers up OK. But when you connect it through a long extender, the overall voltage goes through additional pair of connectors and through the cable itself, so the resulting voltage under the load is insufficient to spin your drive. However, if some other host happens to have a bit more VBUS voltage (can be up to 5.5V in recent standards), the long extender might work again.
In addition, front USB ports are coming via ADDITIONAL cable dongle, which adds more impedance on the VBUS line, and front-facing ports are always less reliable for marginal devices as your HDD.
Solution to your problem is to use a POWERED hub on a long cable. So called "active cables" will likely not work, since they take the power from the same port, and likely will load it even more. Alternatively you might be able to find a different extender cable, the thicker round one, which might have higher current carrying capability, so your HDD might work better. However, this will still remain as marginal solution, and I would not recommend this. For example, plugging another high-powered USB device in the PC will sink the current from the (usually) common VBUS net, voltage will drop slightly, and your HDD might again become unstable or corrupted.
Also you might want to check if your PC has a good PSU, specifically the +5VSB (standby) voltage. If it is on low side (under +5V), you may want to find a better PSU. The other proposition would be to open-up the PSU, reverse engineer its standby section, and beef it up to 5.5V. This should solve your problem, but it is risky and requires some EE skills and tools.