1. Export the UDF sandbox.
2. Unzip the sandbox.
3. Search and remove the unwanted UDF's from all XML files from sandbox.
4. Zip the sandbox again.
5. Import the sandbox.
6. Publish the sandbox.
7. Open the user form from UI form designer. You will not able to see the deleted UDF in UI user form.
8. Take the MDS export command of User.xml and remove all the references of UDF from User.xml.
9. Import the User.xml again through MDS import command.
10. Try to create the same UDF now, OIM will allow you to create the UDF with same detail.