Encountered the weirdest damned Windows 11 bug this week and just happened to stumble upon a blog post in which someone posted the solution, which I will now amplify here:
If all your pinned taskbar icons are broken/blank/generic icons instead of the proper app icons except when the application is running, check your desktop (and possibly inside folders on your desktop) for any executable files. (Shortcuts are fine, just no executable files themselves.)
Delete them or move them somewhere else, and then restart Windows Explorer from the Task Manager. Like magic, mine icons came right back.
No idea how this stupid bug could possibly exist, but there it is. For some reason I had a Firefox executable on my desktop, and it was the culprit for why I had no icons on my taskbar.



