I’ll assume you meant MacBook Pro and not the rather large tower Mac Pro configuration.
Which macOS version? (The macOS 10.13 version shown in the footer won’t boot on an M1, so that’s not it.)
Now as for the Wi-Fi network…
Incorrectly-configured Wi-Fi can cause connectivity issues, as can buggy or failing routers. Check for and apply available router firmware updates, too. If there’s more than one Wi-Fi router present (and configured as a router, not as an access point), that can play havoc with connectivity when subnets are not configured.
How many IP network routers are present? Just one?
Or is there another Wi-Fi router, or maybe an ISP IP router/firewall/gateway box involved?
Does the (presumably) MacBook Pro Wi-Fi network run faster when connected to other Wi-Fi networks elsewhere?
Wi-Fi interference can also be a potential issue. The built-in Wi-Fi troubleshooting tools are adequate and have the benefit of being trivial, while tools such as WiFi Explorer app can make troubleshooting shooting easier.
To view the basic Wi-Fi environment characteristics, Option-Click on the Wi-Fi logo 🛜 in the menu bar, and capture some Wi-Fi network data. Post the items shown in the following image including the Security mode and from Channel to NSS inclusive (Security, Channel, Country, RSSI, Noise, Tx Rate, PHY mode, MCS, NSS, green highlight) (without posting the Wi-Fi address, any local HotSpots that might be present, the network name, or the BSSID, all of which are expurgated from the image shown below, red highlight), and we can take a look at the basic network environment.