I have no idea what "varRowNumber"s value is. I also don't know what "displaying the last record" means - I think of display as having to do with formatting, and you are trying to populate values.... But, I will take a guess. I'm guessing that your main data source field is also repeating.
In that case, you may need to put the rule on the repeating group that contains the txtComment field, so that the rule will fire the appropriate number of times. Or, if you are incrementing varRowNumber, you could put the rule on that....
And you need to also have an index on the repeating group in the /xpathsrc.
concat("CopyRichText /dsnamesrc=CommentList /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[number(", varRowNumber, ")]/d:Comment /xpathdest=/my:myFields/my:grpCategory/my:grpCatComment/my:grpComment[number(", varRowNumber, ")]/my:txtComment")
For example. Of course, I'm guessing that my:grpComment is your repeating group, but it could be any of the other fields. In fact, you may have nested repeating data here - which is more complex.