Before talking of the IP number configuration, let's confirm which ethernet hardware you are really using and whether you're using the correct library. Your program includes Ethernet.h, which is meant to be used with
Wiz850io and this adaptor board.
If you are actually using the
Ethernet Kit for Teensy 4.1, then Ethernet.h is the wrong library. Instead you need NativeEthernet.h.
Before adding the extra complexity of a wireless access point, I would highly recommend connecting to a normal ethernet LAN and get the example program working.
The code you've shown manually configures Teensy IP number to 192.168.1.177. You didn't configure a netmask or gateway address, so the library will choose defaults. You're trying to communicate with 1.1.1.1, which is
Cloudflare's DNS service, which is not on the local network. For this to work, your LAN must have an internet-connected router with internal IP number 192.168.1.1 (the default gateway just replaces the last number of your IP with 1). But even then, it will not work unless Cloudflare's server actually listens for incoming connections on port 10002. I tried connecting just now from my PC and it seems their DNS server doesn't listen to that port (and there is no reason it would), so even if your network settings are perfect, this still can't work until you get the destination IP and port numbers correct.
But the very first step is to check whether you are using the correct library for the hardware you have, and then the 2nd step is to test with one of the known-good examples (like WebClient) on a non-wireless link, so you know your hardware is working correctly. And before adding the wireless link, get a program actually working with whatever remote site you will access and test it with a wired LAN connection first, so you know it works. You must configure Teensy's IP number, netmask and gateway to numbers which work on your local network (LAN). Normally automatic config by DHCP is used, because manual config is tedious and error-prone. For manual config to work, you must get those numbers correct for the settings your LAN uses. Even if the hardware and library and network settings are correct, you can't just imagine an IP number and port and expect that some random server somewhere on the internet will necessarily respond. You have to use the address and port of a server or other computer which will actually talk to you.