Dear all.
I have further information on how to reproduce this bug. I believe this issue is a combination of emacs version 29.1 and later (the issue is absent in version 28.1) and my window manager. My window manager is XFCE version 4.18. In the XFCE settings choose "window manager tweaks", then the "focus" tab and untick the option "activate focus stealing prevention". With this choice, the issue I mentioned with the miniframe losing focus can be reproduced. When the "activate focus stealing prevention" option is selected, then this issue goes away. See settings image here
https://docs.xfce.org/xfce/xfwm4/wmtweaks#focusI hope this helps.