I had already erased my volume before installing Mojave and then Catalina wouldn't install and gave me this same error.
For me, I noticed a greyed out volume, "Untitled" in disk utilities.
In Terminal, type
diskutil list
Which gave:
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *2.0 TB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk1 2.0 TB disk0s2
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +2.0 TB disk1
Physical Store disk0s2
1: APFS Volume Macintosh SSD 1.5 TB disk1s1
2: APFS Volume Preboot 26.5 MB disk1s2
3: APFS Volume Recovery 507.4 MB disk1s3
4: APFS Volume VM 2.1 GB disk1s4
5: APFS Volume Untitled 20.5 KB disk1s5
Notice the last volume is that same "Untitled"?
So, I thought, why not remove this unused volume, so from online I found
diskutil apfs deleteVolume disk1s5
(make sure to to change the disk identifier)
Then I tried to install again and it worked this time and I am writing this note from Catalina, without losing anything!
Hope this helps someone else.
-Drew