the alternate key should apply for both model-driven app and Portal --> this is because it happens at the CDS level
I am asking you to test via Model-Driven App to make sure your key is working properly
that's easy enough to test, go to make.powerapps.com --> apps --> Portal Management --> Advanced Find and locate your entity then create a new record

you can also get there via solution --> make.powerapps.com --> solutions --> your solution --> your entity --> data --> new record
if you are able to create duplicate records it means there is something wrong with the key
also, note that if you already have duplicated record in your CDS, the key won't activate, first delete any duplicates and try publishing the key again