Good Afternoon,
After reading this I have a few quick suggestions but, may change them based on your follow up.
I read the line you put about "database to run properly" are you using a external database like MSSQL or MySQL etc.
Database
If you are then changing the field in your data base for the item creation: Define an INT column as IDENTITY primary key in the schema. Then if you are using virtual tables in Dataverse with a Power Automate frontend to add items you can add items a either set the IDENTITY column as a read-only or Visible=False this will generate a UID without any issues of duplicates if it's on read only they could also copy it for tracking.
Dataverse
If it's a Dataverse it's really recommended that you accept the GUID system as a PK an extra integer column is going to cause issues or require a lot of overhead to keep unique values.
I don't believe its SharePoint but, if it is again us the ID column.
SharePoint
If you need the user to be able to delete it the only option is to use logic like you would for a registration system for a website.
Allow the user to fill the column have a conditional on the submit button for a lookup if the value they wrote exists in the current items in the table it won't allow them to submit project a message to them that value is taken or already exists. This will require a lookup request every time a user types or changes the value and creates a lot of overhead.
Hopefully these answer your question if they do please select this as the solution if not please feel free to follow up with more information this seems like an interesting problem set, I would love to help out.
Have a wonderful day!