This era of Dell is notorious for bad hinges - the piece that screws to the back lid likes to split from the shaft with time, and it requires new hinges - nothing else works. Take a bad set out and pull the part that goes to the LCD and lid off - plain as day when it’s worn since it just pulls off. In most cases you get hinges that feel like they need a dose of Viagra but yes, they can (and do) completely fail like yours did. While it can be repaired, the snag with these machines is this will be a thing you need to keep repairing until you replace the entire laptop with a less troublesome model due to how severely affected these are (unless you know how to spot a good set by feel)! Sellers actually disclose this issue (AND sell the machine for parts) due to how likely it is to completely fail like yours! It's not superficial!!! That said, try to tighten the screws on the port caps, and the D screw under the cap and pray - you can sometimes repair the laptop that way (or at least delay the inevitable, since some will just require new hinges). I can usually tell where the fault lies, so my tip to check WHICH part moves. If the hinges bounce, tighten the screws and hope for the best - if they do not, doesn’t hurt to try but it's probably bad hinges.
Think of it like this: Your car failed (or has issues that correspond to the failure) and it's a known issue. The car is 15-20 years old with 200k miles, and it's either persistent or expensive to fix. Would you fix it or sell the car to a knowledgeable buyer when it breaks and let them know it needs to be fixed, or chase a rabbithole failure? The same principle applies to the pre-E6X20 series Latitudes, especially with the SATA II limitation. Granted I've bought them to toy around with if it's fairly priced, but I UNDERSTAND what I'm buying and where they break or where the snags are so I can run early, especially if there's no permanent fix.
If you’ve 100% ruled it to be the hinges my best advice is if you do fix it change the ENTIRE lid, as well as the hinges. The cost is similar, and if the hinges are on the lid they’re usually in good enough shape you can use them, or are in better to near perfect condition.
However, you may also want to look for a newer laptop, even if it’s not the hottest thing you can buy. The 6400/10 machines are plagued with a SATA II limitation that kill the affair for normal users like you when the drive dies. This is due to Intel not supporting SATA III on mainstream platforms until Sandy Bridge (2011) - not a fault of Dell. While the E6420 fixed the SATA II issue, I usually recommend Haswell at the absolute minimum*. If you can swing 8th gen, go for that with an NVMe SSD - 7th gen is fair game too but if you want to run Win11, you need 8th gen MINIMUM right now**. If you do sell it on to cover the upgrade cost, make sure your buyer is prepared for the SATA limitation - people sell these on without proper disclosure, and then we get asked about them here and have to break the news for the seller. Note: some repairs will total out a Haswell laptop like a major part. Keep that in mind if you buy one.
My E7440 is semi retired due to an aging battery and the cost (and how hard a good clone is to come by) - when it gets to a point it has other issues and it's terminal, it is being fully retired and that’s coming any day now due to a nasty little audio issue (if it is indeed a bad motherboard) - I’m prepared :-). I've more or less moved onto Skylake. My final battery is being passed around until it's dead.
*I do not know of any TPM 2.0 HSW enterprise laptops - these are probably done after Win10 as far as Microsoft is concerned.
**Microsoft is budging on the 8th gen requirement, but only so much. I wouldn’t bet on Skylake (6th gen) getting an official reprieve anytime soon.