Your form version and other details would be much helpful
If you delete and commit normally record will be deleted from table. Any error are you getting when you run this code?
You have unique key field(s) on the table you are trying to insert which actually restricts you from inserting the same value again.
When you are deleting the record and issue commit there is a record to be inserted in the table which is a duplicate that's why you are getting this unique error.
As oracle is not able to insert your commit fails and stops your deletion of record from table