So a contract expires and the same club signs the player as a free agent and a sell on clause is legally enforceable from a contract that has now legally expired? I doubt very much that is the case.
Is there any player where a sell on clause is legally enforceable from a contract that is not the original contract signed?
We received a 10% sell on when Sturridge moved to Chelsea from Man City, 7 years after he left us as a school boy
Lallana joined Southampton from Bournemouth as a 12 year old and Bournemouth received a 25% sell on when he was sold to Liverpool, Lallana was at Southampton for 14 years.
Liverpool signed Sterling as a schoolboy at 15 from QPR and QPR received 20% sell on from his summer move to Man City.
Fleetwood recently confirmed in the last month they have a sell on clause on Jamie Vardy should he be sold, Vardy joined Leicester in Summer 2012 on a 3 year contract, he subsequently signed an extension to 2018 but the original contract would have expired in summer 2015.
Normal practice is the sell on clause applies to any transfer fee received for the specified player. Simple as that, things like length of the original contract, time at club, or new contracts signs don't come into it.
The only time usually when a sell on clause would be waived is if the the two clubs came to an agreement, an example of this is Gareth Bale. When Southampton were in financial trouble Tottenham paid them 3 million pounds in return for waiving any future sell on clause on Gareth Bale, subsequently Bale was sold for 80 million and Southampton missed out on a 20 million pay day.
I'm not a lawyer or football agent but thinking about surely it makes sense that it would be two separate contracts anyway. In a transfer there are 3 different parties involved. The player, selling club and buying club. One contract would be between player and buying club specifying salary, length of contract etc. then there would be a second contract between selling club and buying club specifying transfer fee and other clauses so the length of contract between player and club won't apply to the contract between selling club and buying club.
An agreement between player and club on his personal contract will be separate to an agreement between clubs on transfer details. It doesn't make sense to put it all in one contract.
It's safe to assume transfer is even more complicated that that and there will be many more separate contracts with agents getting involved and other things.