Reinstalling Catalina didn't work for me either but today I decided to smash the nut with a sledgehammer and totally erased the iMac. After doing a SuperDuper backup I booted up in Recovery modem went into Disk Utilities and erased/removed the internal volumes and then added a new one. I then installed Catalina again on that new volume. Low and behold I could then both turn on and off the File Sharing. Great, I thought, until I then ran a software update check and there was a security update for the version that I was running After updating that I found that File Sharing was still on. Brilliant, I thought, until I tried turning it off and it would not turn off.
Just to make sure and as I am retired with plenty of spare time on my hands, I repeated the whole exercise again and decided that the security update is the reason for File Sharing not working.
It's now on and will have to stay that way until they come up with a fix.
BUT.... I have 2 M1 laptops and this 2012 iMac and use the same apple ID on all machines with the documents uploaded to iCloud and available to all devices logged in with the ID. After going through the erasing etc above and setting up iMac with the same ID I cannot seem to access the same iCloud as the other devices. I have checked the log in credentials but the iCloud that the iMac sees does not have the documents that the other devices have. I even went to appleid.com and changed the password which I then had to update on all devices, including the iMac so that suggests that they are all on the same ID.
I'm in the process of restoring the SuperDuper backup so possibly the iMac may then be able to see the same iCloud but if there's something that I'm missing I'd be grateful if you could advise.
Regards