Any classic Whovian will know that the Master is never dead, just renegotiating his contract with life. I just want to know how the writers justified his return as the Mistress in season 8. What in-universe reason is there behind the Master's return?
The doctor answer this question in the final episode of season 10
The Master was last seen, in a semi resurected state charging into Gallifrey in "The End of Time". The Doctor assumes that Gallifreyans cured the master of his problem (semi resurected state) then kicked him out Gallifrey.
Doctor : The last time I saw you, you were on your way to Gallifrey.
Master : Well, I didn't stay why would I stay?
Doctor : So they cured your little condition and kicked you out.
Master : It was a mutual kicking me out
This Master is killed in the last episode of season 10. It is currently unknown if he regenerated into Missy or if there is another regeneration between them
I don't have a particular source, but the general context of the episode and subtext implies that the master turned into missy at the end of that episode. Seeing as how the nethershere:
Was also a secret cybermen construction project
It is likely that the master left the ship and went off into space at that moment to construct the nethersphere. There is likely no delay considering the direct relation of the two projects the master/missy engaged in.
The other answer seems to clear up how he got trapped around a black hole but I never saw the end of time. I've watched all the episodes but missed that one. As far as I've ever known he:
was shot dead by his assistant at the end of season 3 (which I assumed prompted his regeneration into Missy).