You could have also gone directly in the
Custom Field DocType and deleted them from there.
As earlier those fields weren’t a part of the DocType, and many users added it through customize form. But, recently those fields were added to the
Sales Invoice DocType itself and hence caused a conflict with the custom fields of the same name already being there.
So, rather than deleting it from the database, deleting it from the
Custom Field seems more appropriate.