This has to do with how Cloudflare connects to servers. Although it does serve the client via HTTP2 (or HTTP3), it still connects to the server itself via HTTP1.1.
Cloudflare only uses HTTP/1.x between the origin web server and Cloudflare.
I was able to solve the whole problem by changing my .htaccess file from
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
# php -- END cPanel-generated handler, do not edit
As an alternative, you can also try the following. It should work with MAMP for Mac with default MAMP Ports (e.g., 8889 for MySQL). If you personalized the ports, put the corresponding one for MySQL Port:
Search for line starting with $wgDBserver
Replace variable so the whole line looks like as follows: $wgDBserver = "127.0.0.1:...