Zend certified PHP/Magento developer

Magento 2 products not paginating in admin panel

I’m working on an e-commerce that have many thousands of products, something like 80,000 products.

The problem is that when I go to Products page, it keeps loading and then crashes or return a 504 gateway error.
I have tried to increase the timeout to 600 seconds, and it still crashes, so I guess it’s not even paginating the products and returning all.

Is there a way to solve this? maybe like overriding the collection return, thanks!

enter image description here