Hello and welcome to Apple Support Communities, adbaghlaf!
I understand you're trying to reinstall macOS, but see error -2004F. I'd be happy to help you troubleshoot this.
First, try reinstalling macOS with the latest available version: How to reinstall macOS from macOS Recovery
"Shift-Option-⌘-R
Reinstall the macOS that came with your Mac, or the closest version still available."
If you keep running into the issue, try connecting your MacBook Pro directly to Ethernet.
Let us know the results.
Have a great day!