Clipboard does not copy URL properly
I’m not entirely certain how to reproduce this, but if you have this URL passing through keyboard maestro, you could do a search and replace to change the clipboard contents.
https://wiki.keyboardmaestro.com/action/Search_and_Replace
I realize this may not be a good fix if you don’t want to build up all the possible HTML substitutions and this is but one issue you face in a larger problem space.