A personal union occurs when two otherwise independent states (each with their own territories, governments, etc.) come to share the same monarch. Has it ever come to pass that two member states of a personal union fought a war with each other? Note that I mean to exclude civil wars and rebellions; I am interested in those cases where the legitimate, recognized government of a country prosecutes a war against the legitimate, recognized government of another country, and both governments recognize the same monarch as head of state.
The Bishops war between the Covenanters and the Episcopals, in 17th century Scotland. I stand to be corrected, but I don't think the Covenanters had a candidate to replace Charles. So we can say that they accepted he was head of state. The English were against the Covenanters (although it was more complicated than that).
England and Scotland had separate parliaments. I'm not sure that we can speak of separate state and government at this time, though.
The best and closest examples are likely to be civil wars in realms that consisted of two or more kingdoms in personal union. Thus it may be a matter of interpretation how well they satisfy your question.
During the 30 years war Emperor Ferdinand II was king of (part of) Hungary,etc., and Bohemia, Archduke of Austria, etc. At one point Hungarian Rebel leaders and their troops were in the Hofburg threatening Ferdinand to get him to sign a document giving them power when a regiment of his soldiers entered the Hofburg and turned the tables. This is close to being a war between the kingdoms of Hungary and Bohemia (and the Austrian lands) in a personal union. In 1683 Hungarian rebel forces were cooperating with the Turks besieging Vienna and were defeated separately. This again is close to being a war between the kingdoms of Hungary and Bohemia (and the Austrian lands) in personal union.
There may have been Polish-Lithuanian wars when they were in personal union and there may have been Swedish-Polish wars when they were in personal union. There may have been Swedish-Danish wars when they were in personal union in the Union of Kalmar.
Thus it may be a matter of interpretation how well they satisfy your question.
Depending of how you state the events, a candidate could the War of Spanish Succession.
Philip V of Spain was recognized by the Crown of Aragon as King, but he was deeply distrusted (in part of being French, in part because the Borbon dinasty had imposed centralism in France) and later the Crown of Aragon came to support Charles II.
Of course, depending of how you state it, it can be also considered a civil war or just an insurrection again their ruler, but I doubt you will find many examples so close to what you ask for.