Wordpress is so bloated that the more likely issue is Apache/PHP timing out causing nginx to toss that error. WP struggles in its vanilla form due to the amount of resources it needs, and often performs poorly or not at all if you install a lot of extensions.
Some extensions are worse than others, but I can say from experience that WooCommerce, Wordfence, and Elementor are three that almost always lead to broken installs and high load.