MacBook Pro gets different (wrong) IP
The switch is not responsible for handing out IP-adresses, so the fact that they're connected to the same switch does not matter.

It is the DHCP server that hands out IP-adresses. The DHCP server on home networks is usually inside a cabled or WiFi router, but you can also find DHCP servers in other network devices and as a software feature on PCs.

In your case it sounds like you could have two DHCP servers connected to the same network. That is not a good idea if they're not configured to interact, as this will cause configuration issues such as the ones, you're experiencing.

Hunt down the extraneous DHCP server and turn if off to make sure your devices get the right IP-adresses.