I think I've run into a low level defect with SuiteQL. It doesn't seem to like using GROUP BY in a subquery. Here's a simplified example of the issue. Has anyone else run into a problem related to this?
SELECT * FROM ( --- Returns more than 27 rows
SELECT x.ACCOUNT --- Returns 27 rows
FROM TRANSACTION x
GROUP BY x.ACCOUNT
)