You mention “erasing to factory settings”. Just to be clear, are you attempting this from iPad Settings (i.e., Settings > General > Reset > Erase All Content & Settings) or have you actually tried restoring your iPad to Factory Settings? These are entirely different procedures - with different outcomes.
If you have not actually restored the iPad to Factory Settings, having ensured that you have either an iCloud or iTunes backup, follow this process:
Restore your iPhone, iPad or iPod to factory settings – Apple Support
As a diagnostic exercise, do not restore from your backup when prompted to do so, but instead set-up as new - then verify that your storage is clear. When satisfied, as a second step, you can restore data from your backup:
Restore your iPhone, iPad or iPod touch from a backup – Apple Support