Help Custom SWQL Alarm for Group availability Broken after 2019.4 upgrade.

I have been using the following SWQL script for a year now to create a better Group availability alarm. i recently discovered when updating the alarms that the Triggering Condition GUI now says that my Script is invalid. I have tried the Script in SWQL Studio and it tells me that "Cannot use an aggregate or subquery in an expression used for the group by list of a GROUP BY clause". Now here is the crazy bit the script works for one of my alarms but not the others. First here is the broken script 

SELECT Groups.Uri, Groups.DisplayName FROM Orion.Groups AS Groups

JOIN
(Select
t1.ContainerID
,t1.Total
,t1.UP
,t1.name
,Round(t1.test,2) as PercentUp from

(SELECT

CMS.ContainerID AS ContainerID
,c.Name

,Count(CMS.Name) AS Total

,UP.UP AS [UP]

,UP.UP*100/Count(CMS.Name) AS [Test]

FROM Orion.ContainerMemberSnapshots AS CMS

join (SELECT COUNT(Status)*1.0 AS UP, ContainerID from Orion.ContainerMemberSnapshots where Status = 1 GROUP BY ContainerID) AS UP on UP.ContainerID = CMS.ContainerID
join Orion.Container c on UP.ContainerID = c.ContainerID
group by ContainerID, UP.UP) t1
)t2 on t2.Name = Groups.DisplayName
Where t2.PercentUp < 90
and t2.name = 'POOLED-Citrix04_CTXEPPRD'
Order by DisplayName

Now for the working Script 

SELECT Groups.Uri, Groups.DisplayName FROM Orion.Groups AS Groups

JOIN
(Select
t1.ContainerID
,t1.Total
,t1.UP
,t1.name
,Round(t1.test,2) as PercentUp from

(SELECT

CMS.ContainerID AS ContainerID
,c.Name

,Count(CMS.Name) AS Total

,UP.UP AS [UP]

,UP.UP*100/Count(CMS.Name) AS [Test]

FROM Orion.ContainerMemberSnapshots AS CMS

join (SELECT COUNT(Status)*1.0 AS UP, ContainerID from Orion.ContainerMemberSnapshots where Status = 1 GROUP BY ContainerID) AS UP on UP.ContainerID = CMS.ContainerID
join Orion.Container c on UP.ContainerID = c.ContainerID
group by ContainerID, UP.UP) t1
)t2 on t2.Name = Groups.DisplayName
Where t2.PercentUp < 68.64
and t2.name = 'POOLED-Citrix10_CTXEPIC'
Order by DisplayName

the only difference between the 2 are the pooled group names and percentup number. and to add more confusion to all of this POOLED-Citrix10_CTXEPIC does not exiest anymore yet it works. when i change it to the correct name POOLED-Citrix10_CTXEPIC2 when that change is made it breaks like the first script. 

I am at a total loss what do here please let me know if you have any suggestions.