Because the Switch adheres to the WiFi standards in a more strict way, whereas the PS4 implementation is more flexible. This has to do with battery savings implementations on the routers and how well they respond to the Switch requests. In other words, change your router or add a standalone WiFi Access Point.