That Mac was not properly prepared for sale, so erasing it is the correct way to proceed. Unfortunately yours appears to be stuck while attempting to use macOS Recovery over the Internet as explained in the following:
About macOS Recovery on Intel-based Mac computers - Apple Support
If you can't start up from macOS Recovery begins by explaining how it arrives at that point, then explains if it is unsuccessful the "spinning globe" animation eventually ceases, and a warning symbol appears. Even though it hasn't completely given up yet, I suggest following the steps that follow "If startup from Internet Recovery is unsuccessful, you see a globe with a warning symbol (exclamation point)".
I suspect the Internet connection you are using may be unacceptably slow, and given enough time the "globe" icon will eventually arrive at that point. Follow those steps anyway, most of which are attempts to find a better Internet connection.
If that Internet connection is a lost cause, the last step suggests Starting up from another disk or volume or to use a bootable installer to reinstall macOS.
Finally, "If you still need help, please contact Apple Support" but reaching that point means you have exhausted every possible option you can perform on your own, without their help.