What is happening is when you are close to a wall and you lose lock is because your ship spins. If you sit and watch your ship when you are locked on an e-ball, you will notice the spin. Now, when your ship spins AND you are that close to a wall, it loses lock because your ship went out of boundaries. Try this by running in to a wall and see your ship get turned around. It is a normal occurrence and everyone experiences it. Just avoid locking on to an e-ball that close to the wall and you wont lose your lock as often.