Hey this is an interesting one…
So this was a client environment which had initially started with community version so platform.uipath.com. There was no problem publishing the packages without changing the url in the Orchestrator settings, but it was only when I changed it to cloud.uipath.com that I was able to publish the libraries.