The problem is that you are using a repeater, so you need to find out if there are duplicate rows.
I have an old example of doing this here https://github.com/Hube2/acf-filters-and-functions/blob/master/unique-repeater-sub-field.php
But, if this is a readonly field then you will need to generate the unique ID in JavaScript. This depends on how you are generating the unique ID to begin with.