If I understand the question of Yash RS correctly, I want to add one thing that might be relevant. As far as I remember, the lifetime as a deva is not always the same length, but it has a maximum length. Therefore, as soon as that Sakadagami Deva attains higher stage, the mind will not burden the Deva body anymore and be instantly reborn as Brahma in Rupa loka or, if attaining Arahanthood, cease to exist in this world.
So, it is not that the lifetime is always fixed and that “somehow” the Magga phala happens at that time but rather due to the “dhamma niyamata” the Sakadagami has fulfilled the Path at some point and then that Deva bhava stops immediately as a consequence.
I remember there is also a law that all of kama loka will be void of Ariyas at the end of the 5000 years, so due to the perfections of the path any Ariya will attain anagami stage up to that point and “move up”/be reborn at Rupa loka (or not reborn anymore in case of Arahanthood)