macOS does not define any middle-click feature in its apps, such as Terminal. Mostly because Apple does not make 3 button mice. At most Apple has Right and left Click, plus holding modifier keys when clicking.
While not a complete list, there are the macOS Terminal copy and paste options, none of which are click based.
- Command-C macOS Copy to the clipboard.
- Command-V macOS Paste.
- Command-Shift-V will paste the Terminal selected text WITHOUT needing to Command-C copy first. This will not change the clipboard.
- Command-Option-Right-Click will paste the Terminal selected text WITHOUT needing to Command-C copy first (same as Command-Shift-V)
So I would look at Keyboard Maestro for excluding your middle click from working in Terminal, or I would see if you an find what Terminal commands do what you have defined as Middle-Click and then see about mapping that into your Keyboard Maestro command when Terminal has window focus.
NOTE: Middle-Click paste feature does exist in other operating systems, such as Unix/Linux GUI interfaces. Not sure about Windows, as I rarely interact with a Windows system. And I do know that there are 3rd party mice with a middle click, but what that maps to is generally dependent on the mouse vendor and any 3rd party mouse control software you install.