If the subnet the instance is launched in is private, it will be unreachable from the Internet even if you enable "publicly accessible" for the instance. You need to launch in a public subnet in order for the instance to be assigned a public IP. If you have both types of subnet in your subnet group, and RDS picks a public one for an instance, it will work. If you remove the private subnets from the group it will only ever launch in the public ones.
However, I'd strongly recommend against public-facing RDS instances open to 0/0 in the security group. If you must have it publicly accessible, I'd advise scoping that rule down to your current external IP (you can visit https://checkip.amazonaws.com/ to find out what it is).
You could remove the requirement for the instance to have a public IP at all (for you to be able to connect to it) with Systems Manager Session Manager's port forwarding feature.
AWS Lambda not able to connect to public RDS instanceasked 5 months ago
Unable to connect to RDS databaseasked a year ago
How to connect to RDS from DBeaverasked a year ago
Why can't I find my RDS database from my lambda function?asked 6 months ago
After RDS OS patched in an offline operation RDS Database is not accepting connection from outside the VPCasked a month ago
From docker container need to connect RDS - Using Session Managerasked a month ago
Can we two gitlab servers connect to the same RDS postgresql database?asked 2 months ago
migrate database from my local to AWSAccepted Answerasked 3 years ago
Can't connect to RDS database from remoteasked 8 months ago
How to connect Codebuild to RDS database?asked 5 months ago