Honestly I don't know much about this but I think this can occur because PHP (or more specifically, the PDO extension) isn't necessarily aware of the health of the PostgreSQL node it's connected to. From PHP's perspective, it opened a connection, and unless explicitly told otherwise, it will assume the connection remains open. The Patroni switchover/failover is happening independently of PHP. PgBouncer is probably a good solution for this.
I've been a developer for 7 years and at some point I felt like I had seen everything there is to see in my field (mostly PHP programming) so I started looking into other languages and came across the Fireship channel which covers a ton of different technologies in short and fun videos.
It's nothing too deep but it's entertaining and has helped me expand my interests/curiosity.
Hey, welcome! Classic haha, I have far too many pet projects as well ๐
And yeah agreed, it's a bit dizzying to choose a Laravel "path". Would probably be helpful to have a documentation page sort of like the Remix Stacks where they talk a little bit about which "path" to choose depending on app needs.