Adding a Group ID to a query where the sort by is not based on the Column your grouping by I am trying to add a groupID column to a query where the column the grouping is based on is sorted randomly

DECLARE @t TABLE
(
  ID INT primary key IDENTITY(1,1),
  ProductID INT,
  QuestionID INT
)


INSERT INTO @t (ProductID,QuestionID) 
SELECT  ProductID       
        ,QuestionID    
FROM    dbo.Products p WITH(NOLOCK)
JOIN    dbo.Questions q  WITH(NOLOCK) on p.StudyID = q.StudyID
WHERE   p.StudyID = @StudyID
ORDER BY FIRST_VALUE(CRYPT_GEN_RANDOM(4)) OVER (PARTITION BY ProductID ORDER BY ProductID),
        ProductID,  
        QuestionNumber

SELECT ID,ProductID,QuestionID       
       , DENSE_RANK() OVER(ORDER BY ProductID) as ProductGroupID   
FROM   @t t  
ORDER BY ID


Every time the query is run there is a random sort off the ProductID Column.
I trying to get the GroupID to be 1,2,3 etc...  no matter what ProductID is first.

This is my goal
Example:

     ID  | ProductID   | GroupID   |  QuestionID
    -----|-------------|-----------|-------------
     1       22             1              2
     2       22             1              3
     3       22             1              5
     4       11             2              2
     5       11             2              3
     6       11             2              5
     7       44             3              2
     8       44             3              3
     9       44             3              5


If you re-query it should be:

     ID  | ProductID   | GroupID   |  QuestionID
     ----|-------------|-----------|-------------
     1       44             1              2
     2       44             1              3
     3       44             1              5
     4       11             2              2
     5       11             2              3
     6       11             2              5
     7       22             3              2
     8       22             3              3
     9       22             3              5


and again:

     ID  | ProductID   | GroupID   |  QuestionID
    -----|-------------|-----------|-------------
     1       11             1              2
     2       11             1              3
     3       11             1              5
     4       44             2              2
     5       44             2              3
     6       44             2              5
     7       22             3              2
     8       22             3              3
     9       22             3              5
The easiest way in my opinion would be to just add the randomly ordered sequential integer in the SELECT from Product before the join.

WITH Prod
     AS (SELECT *,
                ROW_NUMBER()
                  OVER (ORDER BY CRYPT_GEN_RANDOM(4)) AS ProductGroupID
         FROM   dbo.Products
         WHERE  StudyID = @StudyID
         )
SELECT ProductID,
       QuestionID,
       ProductGroupID
FROM   Prod p
       JOIN dbo.Questions q
         ON p.StudyID = q.StudyID
ORDER  BY ProductGroupID,
          QuestionNumber