Internet gateway takes precedence over routers

I have a Synology NAS DS920+. It is connected to a switch (Netgear JGS516) that has multiple devices hooked to it including a T-Mobile gateway and an ASUS router (mesh setup, one ethernet, second wireless) to which my desktop computer is connected (ethernet). Several months ago, my routers quit, and I had to factory reset them. Before that, I could access the NAS from within windows File Explorer via mapped drives. It had been working that way for about 2 years.
After resetting the routers I lost connection to the NAS. After some time I discovered the NAS adopted the T-Mobile ip assignment (192.168.12.174 & 192.168.12.175). The router is 192.168.50.1. I could not get the NAS & computer to talk. I moved the NAS to the desktop and connected ethernet directly and they started working together as before the router issue.
Question: How do I get the NAS to connect to the desktop through the switch?

You have two subnets in your network. Sounds like you are double NATed and they are both connected to the same switch (not good). Your T-mobile is acting as your router and your modem and your ASUS is competing with it to be your router. Not good. If you want to keep your router, and as a long term fix, you need to ask the T-Mobile tech support if it’s possible to put your T-Mobile gateway into “bridge mode” to let your ASUS do all the routing. You will also need to ask if the LAN ports on the back of the Gateway can also act as WAN ports. T-Mobile tech support can help to bridge the Gateway if it’s possible. If all is possible, you will need to connect one of the T-Moble LAN port to the WAN port on your ASUS. Then connect from one of the ASUS LAN ports to the Netgear Switch.

If T-mobile says that their Gateway cannot be “bridged” and the two yellow LAN ports on back cannot act as WAN ports then the easiest thing to do is lose the ASUS and let T-Mobile Gateway do it all. Then plug your switch into the T-Mobile LAN port any use the switch for your ethernet connections.

Either of the above two scenario you will eventually see your NAS again.

Bridge mode is when you tell your T-Mobile Gateway that you don’t need it to be your router because you already got one (ASUS). It also tells the T-Mobile to just be the connection to the internet for the ASUS and that’s all.

Find out if you can bridge the T-Mobile and then we can discuss the network setup further.

Sorry for the late reply and thank you for taking the time to answer, I cannot imagine how busy you must be.

The gateway and switch are located in a small closet and my two meshed ASUS routers are at the edges of the 2-story house with a partial basement to achieve coverage on our 2.5 acres. (we have Kasa switches that need the connection) The physical limitations this presents would not allow me to put everything together so I added a small Netgear switch next to the desktop and NAS. It is fed by the gateway via the original switch via the only ethernet cable that goes between the two. For whatever reason thankfully, this setup is working quite well.

Again, my sincere thanks for your suggestions. If I ever get a chance to modify the locations of the equipment I will certainly do as you have said.