I can’t use Mouse4 for melee only on a few heroes, haven’t tested every hero but at least on tracer and sojourn it is an issue, it is very annoying since I have it bound to all other heroes so it ruins my muscle memory when I can’t do it on some of my favorite DPS. I press Mouse4 and it simply does nothing but play a little sound.
Go through all the settings for those heroes and double check that mouse4 isn’t bound to something else as well as melee for those heroes.
I had this issue recently where a button wouldn’t work for a few specific heroes but worked fine for others, turns out the button for those heroes was also bound to a different action and it just picked that action instead of the action I wanted anytime I pressed it.