Since F7, F8 and F9 work when assigned other shortcuts in Karabiner-Elements, the physical keys are likely working. The goal now is to find out why they no longer control media playback in any app.
First, go to System Settings → Keyboard → Keyboard Shortcuts → Function Keys. Check whether “Use F1, F2, etc. keys as standard function keys” is enabled.
If it is, try holding Fn/Globe while pressing F7, F8 or F9. See Apple’s keyboard settings guide.
Next, quit Karabiner-Elements completely and test the keys in Apple Music.
If they still don't work, start your Mac in Safe Mode and test again.
If the keys work in Safe Mode but not during normal startup, software that loads at startup may be involved.
If the problem continues, open Karabiner-EventViewer, temporarily disable Karabiner-Elements modifications, and check which events appear when you press F7, F8 and F9. See Karabiner’s troubleshooting guide.
If these checks don't identify the cause, try the keys in a new macOS user account.
You can also test media keys on an external keyboard, if available.
These tests may help narrow down whether the problem is specific to your account or the built-in keyboard.