Error code 5010F indicates that the Mac is having trouble connecting to Apple's servers to download the necessary files for installation. Here are some steps you can try to resolve the issue:
1. Check your internet connection: Ensure that you have a stable internet connection and that your network settings are properly configured. You may want to try connecting to a different network to see if that resolves the issue.
2. Check Apple's System Status page: Visit Apple's System Status page to see if there are any known issues that may be affecting the download process.
3. Reset the NVRAM/PRAM: Shut down your Mac and then turn it back on while holding down the Command + Option + P + R keys until you hear the startup sound twice. This will reset the NVRAM/PRAM, which can sometimes resolve issues with the Mac's firmware.
4. Try a different installer: If you're using Internet Recovery, try using a different Wi-Fi network or connecting via Ethernet. Alternatively, you could try creating a bootable USB installer for the OS you're trying to install.
5. Contact Apple support: If none of these steps work, it's possible that there's a hardware issue with your Mac. You may take your Mac to an authorized service provider for further assistance.
I hope these steps help you resolve the issue and successfully restore your Mac to its original OS.