Try the solution suggested over here: https://andrewsutherland.azurewebsites.net/tag/storefront/
Solution:
Removing the lock can be achieved by executing the following script against the commerce shared database.
Update the database name and catalog friendly id values, in the highlighted lines, as appropriate.
USE SitecoreCommerce9_SharedEnvironments
GO
DECLARE @catalogEntityId VARCHAR(MAX) = 'Habitat_Master';
DECLARE @uniqueId VARCHAR(MAX);
DECLARE @entity VARCHAR(MAX);
DECLARE @modifiedEntity VARCHAR(MAX);
SELECT @entity = Entity,
@uniqueId = Entities.UniqueId
FROM sitecore_commerce_storage.CatalogEntities AS Entities
INNER JOIN sitecore_commerce_storage.CatalogEntity AS Entity
ON Entities.UniqueId = Entity.UniqueId
WHERE Id = 'Entity-Catalog-' + @catalogEntityId
UPDATE sitecore_commerce_storage.CatalogEntity
SET Entity = JSON_MODIFY(@entity, '$.ParentCatalogList', '')
WHERE UniqueId = @uniqueId
Now that we have released the lock, we can associate the catalog to our site.
It worked for me for similar kind of issue.