I think CTE is red herring here, the problem is in the sub-query regardless if it's in CTE or not
Yes, it is a red herring for sure; using a limit without a sort in a sub-query is always an issue.
Yes, it is a red herring for sure; using a limit without a sort in a sub-query is always an issue.