The Security groups are just one of the factors needed to enable access. There are multiple other parameters like NACL's, Public IP, Routing etc that need to be verified between the 2 environments before reaching to a conclusion. Have you checked the routing that is set ?
Assuming, you are trying to access the same from On-Premise over the internet, did you verify if Internet gateway is attached to the routing in the EC2 instance. Please verify the same or provide more information on how is the routing set up.
inbound rule of security group for EC2 Instance in private subnetasked 10 months ago
With a Security group I can't connect to EC2 instanceAccepted Answerasked 2 months ago
Security Group Inbound Update Not Workingasked 2 years ago
What do I need to allow for my Security group to receive inbound traffic from SQS in lambda?asked 8 days ago
(t2.micro) Editing port rules in Security Group makes no changes - Can always ping port 3389, but 22 failsasked 8 months ago
Sending UDP traffic to EC2 host from ECS instance, security group issue on EC2 hostasked 7 months ago
Can't access Instance using custom network acl * security group rulesasked a month ago
HTTPS Security Group not allowing access to EC2 instance when tried using HTTPS URLasked 4 months ago
security group for session managerasked 7 months ago
Can't connect to EC2 with chained security groupsasked 9 months ago