Yes, adding .git at the end of the URL seems to work. Great spotted!
Here’s some more detail. I got discourse-masonry-image-gallery installed and after updating Discourse I got the following error message.
I remember installing it from the URL without .git at the end since the example URL doesn’t end with .git.
I also tried to install another theme from gitlab (without .git) and got the following message.
In the test above I tried to install discourse-agora-theme, also a public gitlab repo.


