From googling around it seems like this feature does exist in general, it’s just that applications need to actively support it and I have never seen it myself. (Notification Badge on Taskbar Programs)
I tried using the “–class=” and “user --profile-directory=” options and everything else – it doesn’t work the way I need it to.
I personally use this to have two firefox profiles running. Using .desktop files in ~/.local/share/applications/ I can set a different application Icon via class for the second profile instance to easily differentiate them.