Please provide a more complete description of the steps in your workflow. At what point (and why) are you "copy and paste" the URL address? Usually, you click a URL.
Also, tell us what version of InDesign and what computer platform you're using.
You may have accidentally added a space when pasting URL into the field. You can check the URL entry by going to the flyout of the hyperlinks panel > Hyperlink Destination Options > toggle to the problem destination and select > Edit > delete any extraneous spaces at the end of address.
You should not copy styles to test them, use the Hyperlink Panel as it is checking the link.
InDesign will mark URLs with spaces and extended characters (like öäß…) as imvalid, you would have to replace them with their escape code, this code in combination of % and a number, even if it is allowed nowadays, but not every browser supports it and InDesign is very restrictive.