I originally had the entity_id as a (bit more roundabout) standalone expression, not referring to a form field - I put that in the 'notes' sheet, it was reversed logic but basically the same.
if(${create_update}='create',uuid(),instance('Goals')/root/item[selected-at(${calc_ext_goal_IDs} , ${rep_number} - 1) = name]/name)
I updated it to the following, just to separate it from the form field calculated value (as well as removing the coalesce from the form field to use as a comparison - this did now return blank for the create case);
if (${create_update}='update', selected-at(${calc_ext_goal_IDs} , ${rep_number} - 1) , once(uuid()))
The @id value was still correct for repeat #1, wrong (new UUIDs) for the rest. Deleting eg repeat #2 and re-adding returned yet another new UUID. Deleting all and adding a fresh #1 also returned a new UUID, not the expected value.
I never saw an error in test_UUID - it always showed the expected value from the entity list.
To try to get correct behaviour I followed your changes more closely and duplicated the entity_id value
entity_id as if (${create_update}='update', ${entity_UUID}, once(uuid()))
coalesce was already removed from entity_UUID
once removed from test_UUID (field duplicated below to keep it as comparison)
Outcome was unchanged - #1 ok, #2 onwards not ok, delete all repeats and recreate #1 and then #1 not ok. Collect still works for 1, 2, ... and also after deleting all repeats and recreating.
screenshots
#1 original - correct UUID
#2 original - new incorrect UUID
Delete 1 & 2 and recreate, both have new incorrect UUIDs
It seems there's still some other difference between your edit and mine if yours is working properly - but I don't know what it is.
File
webforms entity UUID issue.xlsx (97.5 KB)