Well, I didn't solve the problem, and while I don't recall the exact nature of the problem anymore, I remember that my solution involved removing Selenium from the project and migrating my API from Render to Railway. After these changes, everything functioned correctly. I suspect the core issue was related to an unstable IP address associated with a specific port on the previous hosting service (Render).