OK, so I found out the source of the problem. If you right-click on Firefox's title bar, there's a "Customize toolbar..." button you can press. That will open a tab called "Customize Firefox", and in the bottom-right corner of that screen there's a checkbox "Title Bar" that is unchecked. It should be checked, and checking it immediately fixes the theme issue.
This box is checked by default in Kubuntu 22.04, so something must have changed that made it no longer checked by default.
OK, so I found out the source of the problem. If you right-click on Firefox's title bar, there's a "Customize toolbar..." button you can press. That will open a tab called "Customize Firefox", and in the bottom-right corner of that screen there's a checkbox "Title Bar" that is unchecked. It should be checked, and checking it immediately fixes the theme issue.
This box is checked by default in Kubuntu 22.04, so something must have changed that made it no longer checked by default.