Your sentence has two clauses. “Dev’s wife” is the subject of the first (subordinate) clause; “he and Miranda” is the subject of the second. The subjects of the two clauses do not have to be the same (consider “While my wife travelled to India, I stayed at home,” which is obviously grammatical).
There is no actual rule of grammar that says that a pronoun cannot refer back to a noun phrase used in the “genitive” construction (Dev’s). This is a misconception that unfortunately was widely publicized due to some prescriptivists arguing that a grammatical sentence from a PSAT test actually contained an “error”. See Usage of possessive pronouns in subordinate clause or main clause?
Another misconception that might be confusing you is the idea that a third-person pronoun has to refer to the most recent noun phrase. This isn't true either. Some people might choose to try to follow this rule as a way of avoiding certain kinds of confusing ambiguity, but as you point out, no ambiguity is possible in this sentence because "Dev's wife" would not be described with the pronoun "he".