In the event that this is still a pending issue, I suspect your error may be related to the MySQL server system variable "skip_name_resolve". With "skip_name_resolve" disabled, any temporary DNS issues can lead to sporadic connection errors like you are seeing.
There also appears to be additional security benefits to enabling this server variable. The following links address both why this should resolve your issue and the security benefits of it (Note: I did not write this content and I don't guarantee that it is AWS or Lightsail specific).
I see you're already familiar with modifying Lightsail database parameters, but here is the documentation for doing so if needed.
Lightsail Load Balancer with Plesk Ubuntu Wordpress Instancesasked 4 months ago
Lightsail - EC2 - Instances Hard Limitasked 5 days ago
Lightsale instances cannot connect to Lightsail database
Do lightsail container services have a public IP?asked 2 days ago
Lightsail container - connect to ElastiCacheasked 7 months ago
Newly Created Lightsail Instances - refused to connect errorasked 9 months ago
Can't connect to MySQL db from Lightsail instance. MY-010055 warning in logs.
lightsail with LAMP stack with php 8.* or with AMI supportasked 5 months ago
Cannot connect to Lightsail instancesasked 4 months ago
LightSail LAMP PhP with Postgresql database suddenly extremely slowasked 2 months ago