Wireless can have wildly variable latency, which is why it's not best suited for online games.
I'm assuming you used Ookla speedtest or something similar. That takes a snapshot of your latency at that moment. Your latency could be very different just seconds later. Latency varies on a wired connection as well, but not as much.
If running an ethernet cable between your PC and switch isn't feasible, you could also buy powerline adapters. These depend on the quality of electrical wiring where you live, but typically, modern powerline adapters are almost as good as a direct ethernet connection.
Cheers!