I had this error message in relation to an AWS::EC2::LaunchTemplate and the problem was that I'd set the SecurityGroups field when I should have been setting the SecurityGroupIds field instead. This change fixed it:
AWS::EC2::LaunchTemplate
SecurityGroups
SecurityGroupIds