Task Switcher default wayland icons - use the same icons as taskbar (icons-only task manager)?

Some applications are using the default wayland icon in my Task Switcher. There have been a number of threads about this kind of issue across various forums, but:

  • the solutions are per application, making it untenable for less technical people
  • the common “set desktop file name in window rules” workaround only works partially for me: the custom compile of firefox nightly i use, for example, only has its first window changed to the firefox icon.
  • they have the same issue for the taskbar (icons-only task manager) as well, which has the correct icons for me

The latter point is what makes me hopeful there could be a generic solution. But so far I wasn’t able to figure out whether I can somehow influence how the Task Switcher chooses its icons, and whats different about the taskbar.

I would appreciate any ideas or help for a generic solution, including ideas for writing KWin scripts or similar.

System Details

Operating System: EndeavourOS (with CachyOS repos)
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.16.8-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 9900X 12-Core Processor
Memory: 32 GiB of RAM (29,9 GiB usable)
Graphics Processor 1: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2
Manufacturer: ASRock
Product Name: X870E Nova WiFi

I have the same problem in the latest Neon. Just a blank on the taskbar where Firefox should appear. It’s OK on the menu, and no other app does this.