Based on your description, I guess that you can create a new user account to fix all options under the Erase button graying out in Disk Utility and then perform the formatting work in Disk Utility again.
The new admin account creation work is quite easy and I am gonna show you how to do it:
Step 1: Open System Preferences by clicking the Apple menu on your device.
Step 2: Locate the Users & Groups tab and open it.
Step 3: Unlock the lock with your user password and then click the plus (+) icon to create a new admin account.
Step 4: Log out of the account that you're running and then log into the new one that you create.
Step 5: Select your old account in the Users & Groups tab and click the minus (-) icon to delete it.
Step 6: Launch Disk Utility and complete the formatting work of your drive.