When you conduct a combat, there’s a sequence you follow. The decision to retreat comes after both sides fire, so you have to conduct at least one round of shots before you can retreat.
Yes, you can end up moving farther than you would normally be allowed to.