To work around this nagging problem, I use explorerPatcher https://github.com/valinet/ExplorerPatcher and set the "Taskbar style" to "Windows 10 (ExplorerPatcher)".
This completely replaces the Windows Taskbar with its own implementation. (Read the info on the Github page for details.)
BEWARE that if you have Windows 11 24H2 you need to use the above "Taskbar style" setting to use this app. You will also have to tweak your Windows Defender settings. The developers of the app and several other Windows 11 Desktop enhancement apps believe that Microsoft is trying the prevent apps like this from working. The Github page has information on this as well.