I am presuming you can fire up macOS Disk Utilities in Recovery Mode (cmd-Opt-R) if you can then open up Terminal from the pull down Utilities menu and enter: dscacheutil -flushcache and press return. Reboot back into Recovery Mode and try connecting again "Reinstall macOS" selection. If it asks you to connect to a particular Network select your modem NOT your mac network.
You might find this helpful: How to Fix Mac Recovery Mode not Working on High Sierra?
Cheers and Good Luck
iMac 27" [14.2] (late 2013), Airport Time Capsule 5th gen, iPhone13 x 2, iPad6, iPad Mini5, Spark Smart Modem 1st Gen
Panasonic TV Viera TH-L50E6Z (1080p), Panasonic Blu-ray PVR DMR-BWT835, Yamaha AVR RX-V1085 [6.1 Surround Speaker System], Apple TV 4k 64Gb (2nd gen)
Kia Sportage Urban EX (2019), Suzuki Swift SR7 (2011)
The difficult we can do immediately. The impossible takes a bit longer. But Miracles you will have to wait for.