Microsoft support has thoroughly explained the behaviour as follows -
I concluded that the error (error label is SYS191391) happens in a particular scenario and comes from class EcoResProductDetailsExtended method validateDelete.
The behavior has been previously reported:
Issue 471596 - By design - Error deleting new Released Product: Product has been released to a company and cannot be deleted - fix.lcs.dynamics.com/.../Details
In current product design, if the Retail key is enabled, when deleting a released product there is a check coming from Retail-specific code in EcoResProductDetailsExtended form, validateDelete for InventTable datasource.
If record exist in table RETAILASSORTMENTLOOKUPEXPLODED, product is assorted and the reported error appears:
"Product has been released to a company and cannot be deleted"
Retail assortment lookup/EcoResProduct are not company specific. When the check runs and it finds a record, regardless of legal entity, the delete will fail.
So, when trying to delete Released product with Item number '5095977', the system finds a related record in table RETAILASSORTMENTLOOKUPEXPLODED.
There is indeed the matter of having product number '5152462' released incorrectly with Item number '5095977'.
But this should just mean that more than one related record might exist in RETAILASSORTMENTLOOKUPEXPLODED.
The situation has been resolved in the past by following these steps and, in current case, the steps are to be repeated for each legal entity ('FAM','FMHK') and each Product ('5095977','5152462'):
A. Check if the product is added to any assortment:
A.1. by running a query on table RETAILASSORTMENTLOOKUPEXPLODED
A.2. or from UI: Retail and Commerce > Catalogs and assortments > Assortments
A.3. or by using SysTableBrowser add-on and replacing URL parameters with (where cpm=1 is to be set with your legal entity):
?mi=SysTableBrowser&TableName=RETAILASSORTMENTLOOKUP&cmp=1
B. If yes:
B.1. In the related Assortment, delete records line for the product from UI: Retail and Commerce > Catalogs and assortments > Assortments
B.2. Open the released product in all Legal Entity's > Product Categories > Remove all assigned Category
B.3. Run "Process assortment job":
learn.microsoft.com/.../assortments
C. Delete the item which has no transaction from the "Release products" form (the error should no longer appear)
D. As needed, release again products, put back products in Catalogs/Assortments and run "Process assortment job"