When you delete the lab1.template, the template is deleting the LogGroup with name /var/log/messages but the EC2 instance has a cloudwatch logs agent which is creating a LogGroup with name /var/log/messages to log messages while EC2 is shutting down. The issue with this is later when you rerun the lab1.template in the same account it will fail saying LogGroup with name /var/log/messages already exists.
When you delete the lab1.template, the template is deleting the LogGroup with name /var/log/messages but the EC2 instance has a cloudwatch logs agent which is creating a LogGroup with name /var/log/messages to log messages while EC2 is shutting down. The issue with this is later when you rerun the lab1.template in the same account it will fail saying LogGroup with name /var/log/messages already exists.