Where is the MacBook in relation to your base station?
While the 5GHz band offers higher throughput than 2.4GHz, it has a shorter range and is more affected by walls and other obstructions.
It may be that you're at the limit of the 5GHz range and that the 2.4GHz signal is stronger, so the MacBook prefers that.
it may be that the position of your MacBook on your desk is somehow blocking the signal (e.g. there's a monitor or printer between the MacBook's antenna and the base station that doesn't get in the way of the phone).
It may also be there are other 5GHz networks in range that are using the same frequency, and this is affecting your signal strength.
There are a couple of things you can try. There are third-party apps that can scan the wifi spectrum and identify signal strength and interference levels. https://www.intuitibits.com/products/wifiexplorer/ is one example (with a 3-day free trial which should be long enough to see if it identifies your problem).
Another option (if supported by your router) is to temporarily configure your base station to use different SSIDs for the 5GHz and 2.4GHz networks. This will let you force the Mac to use one or the other. You can then join each one manually and get an idea of the signal strength (you can use an app like https://www.speedtest.net/ to get a comparison on the different networks.
Once you can identify the problem you can find the solution. It may simply be repositioning the base station, or replacing the base station with one that has a stronger radio transceiver (or a mesh network of multiple base stations). It may be a simple configuration change (e.g. force the 5GHz network to an unused band that your neighbors aren't using). Lots of options... just need to know the cause first.