Apple - Macbook failing to connect to 5GHz networks

Most likely your Airport Card has failed.

On your particular Mac, it uses the BCM94360CS custom SoC (System on Chip) that supports dual-band WiFi and Bluetooth. The critical part related to your issue is the "dual-band" WiFi; it uses two different radios, not one. So, it's completely plausible that one radio has failed (5GHz) while the other (2.4GHz) continues to function; this is what you're seeing.

enter image description here

Image from iFixit.com

To verify that it's not a software issue, you should boot into Safe Mode (hold ⇧ Shift) and/or Recovery Mode (⌘ Command R). If the problem persists, it's a hardware issue.

You'll just need a replacement AirPort adapter which is fairly inexpensive. It's also a fairly straight forward fix, basically remove the back cover, disconnect the Wi-Fi and Bluetooth antenna, then remove the AirPort card. Replace with the new one and reverse the procedure to reassemble everything. iFixit.com has an excellent step-by-step guide you can follow.

However, if opening the back of your Mac is not your cup of tea, let a professional handle it for you.