See below 2 points from the documentation; what you are seeing is expected behavior. You can use Elastic IP instead of Public IP if you want persistent behavior.
We release your instance's public IP address when it is stopped, hibernated, or terminated. Your stopped or hibernated instance receives a new public IP address when it is started.
You cannot auto-assign a public IP address if you specify more than one network interface. Additionally, you cannot override the subnet setting using the auto-assign public IP feature if you specify an existing network interface for eth0.
Unable to access EC2 Instance over the Public IP Addressasked 5 months ago
Why does ELB need one public IP address for each public subnet?asked 3 years ago
New EC2 instance within default public subnet doesn't get public IP addressasked a month ago
EC2 instance doesn't get a new public IP after Elastic IP is disassociatedasked 7 months ago
Why it isn’t re-assigned a public IP address and public IP DNS for a Instance in a public subnet after stopped and started in case of attached 2 eni.Accepted Answerasked 3 months ago
Redshift - Why does Node of redshift cluster in private subnet has public IP.asked 6 months ago
ENI and public IP addressasked 4 years ago
EC2 in public subnet reachable by public IP but not by public DNSasked a month ago
EC2 instance public IP and DNS IP not workingAccepted Answer
AWS EC2 instance public ipv4 and DNS address not workingAccepted Answer