In QQuickPopupPrivate::finalizeExitTransition(), there is a loop searching for the next Dialog with highest-z. Once found, we test if it has focus = true and gives it activeFocus. If this Dialog has focus = false, the code does not try to give the focus to the next dialog in the chain.
With the attached sample, if you press on the keyboard the keys Up, Left, Right and again Right, the focus is not given back to the Dialog1.
Attaching the possible patch too.