Sorry to hear you had issues.
Is a harmful command if you are don't have a migration update from a pre-v5.0 version of Pi-hole (as is the case for a fresh installation). This will be clarified by the next update which is planned soon.
Please remove the broken database
sudo rm /etc/pihole/gravity.db
and reconfigure your Pi-hole using
pihole -r
where you chose "Reconfigure" to get a fresh database.