The idea behind connecting them to the system close together (within 150mm) is so that the pressure in each is the same. That way there is no tendency for water to circulate via the expansion tank.
With any other layout there are two possible problems depending on which is at the higher pressure and how much difference there is..
1) Pumping over via the vent pipe (the problem you had) or
2) Drawing air in via the vent pipe and water going the wrong way up the feed (and possibly out of the tank overflow).
If the vent is connected to the return that might be at a relatively low pressure (because the pressure created by the pump has been lost by the time the water gets through the rads and back to the return where the vent is connected). In other words you might get problem 2) with the system drawing in air via the vent.
If you swap the pipes and get neither of these problems you got lucky. However you might ge problem 2) if the pressure changes in the heating system. For example when the TRV shut down and restrict the flow or the system gets a bit silted up.
I've sometimes wondered if using one pipe up into the loft would work. eg something like this. Perhaps the_scruff can tell us if there is a regulation or other problem with this approach (I'm not a plumber!). The pipe would need to be 20mm (I think that's a regulation for vent pipes?)