sebobo, Been having problems with 2 local #PHP projects on my Mac closing the connection when using PHP-FPM. Finally after almost 1 year (since Sonoma apparently) I found the solution:
The 2 projects were the only ones using PostgreSQL.
I was able to work on them with the PHP Server, so I only tried debugging the issue once in a while.