That's an Internet Recovery error. It's trying to access Internet Recovery or Apple Diagnostics via the internet and either can't connect or is timing out.
2 replies
Upgrading requires that you download the macOS upgrade installer: How to download macOS High Sierra.
MacOS upgrade error -5010F