It's not as hard as you're making it out to be. You don't need to perfectly align the locking mechanism - just like most car door locks and convertible top mechanisms, you can build a trap in - as long as it hits somewhere in the basket, it'll pull down into the exact position.
Similarly, both the lock assembly and the hinge can be built with adjustment tolerances in their mountings so they can be aligned to the right spot during installation.
These days those sorts of things should be much less necessary with solid modeled assemblies and NC machined tooling and laser verified component geometry - but there are tried and true solutions to all of them.
Walter