I have SharePoint URLs that I'm adding in comments via automation to our users to remind them where to get certain documents, and the URLs always break at a space in the URL.
Welcome to the Atlassian Community!
URLs with spaces in them are not valid. Spaces need to be encoded to be used within a URL, as you've found with the %20
I don't know if or when Microsoft might fix Sharepoint such that it stops allowing us to put spaces in its URLs.