I am having the same issue. For what I read that typing comes from postgress and in your returned data you have to first type is as "unkown" then type it as your RowType.
Example: return data as unknown as RowType<T>.
Then hover on Data and you will see that data has a type from postgress you have to remove first... Weird I know.