When you press a key while the cursor is over a unit frame, the unit frame doesn't intercept the key press the way it intercepts mouse clicks. This is why your macro would work as expected if bound to a regular key, but doesn't work as expected when bound to a mouse button. As o...
To make a basic mouseover macro, go in your character-specific macros window and click “New.” You’ll be prompted to choose a name and an icon for your macro. I usually assign a two-letter code for the spell. For example, I use LB for Lifebloom and RJ for Rejuvenation. But you ...