Step 1: Right click an open Picture-in-Picture window. In the context menu, select “More Actions” -> “Configure Special Window Settings…”. This will populate most of the window settings for you.
Step 2: Click “Add Property…” and select “Window title”. The newly added row’s text field should read “Picture-in-Picture”. Change the dropdown option from “Unimportant” to “Exact Match”. (All PiP windows in Firefox use this title and by making it Exact Match the rule shouldn’t affect any other Firefox windows.)
Step 3: Click “Add Property…” again and this time select “Keep above other windows”. The dropdown in the newly added row should be set to “Apply Initially”. Select the “Yes” radio button if it isn’t already.
Step 4: Click “OK”. That’s it. No more manually setting Keep Above every time you open a PiP.

source: https://www.reddit.com/r/kde/comments/osjt3p/firefox_wayland_pip_workaround_or_how_i_learned/
If it is not possible to have the “more actions” menu you can apply this workaround:
add MOZ_ENABLE_WAYLAND=0 to /etc/environment to force the use of xWayland
https://discussion.fedoraproject.org/t/wayland-and-firefox-picture-in-picture/135216/3