Hello,
Also, macOS 10.15 Catalina appears to be the latest supported system for a printer driver from Brother for this model.
https://support.brother.com/g/b/downloadlist.aspx?c=us_ot&lang=en&prod=hl3170cdw_all&os=10060
Even if a Catalina driver possibly would work with one or two newer macOS versions, a normal recommendation from the printer manufacturer (for other models) would be to use AirPrint for Monterey.
>I cannot add the printer nor print to it from either Mac or iOS devices
If the problem returns, device discovery difficulties with AirPrint could be the reason. In such a case, you may want to try the following procedure (in this order, with these waiting times):
Power off the Wi-Fi router, the printer, the Mac, and all other devices/computers. Wait two to three minutes. Power on the router. Wait two to three minutes. Power on the printer. Wait a minute or two. Power on the Mac. Finally, power on all other devices/computers.
How is your HL-3170CDW connected to the Wi-Fi router? If wirelessly, you could perhaps try to wire the printer by Ethernet to one of the LAN ports instead. AirPrint works with wireless (Wi-Fi) or wired (Ethernet) network connections.