Seen quite a few diffs like this: https://zh.wikipedia.org/?diff=62989766
Looks like the reply tool probably shouldn't be separating these templates from their comments.
- Write a top level comment, followed by a category, or template that includes a category, e.g. Comment. ~~~~ [[Category:Test]]
- Reply to that comment with the reply button
The category moves to the end of the page: https://meta.wikimedia.org/w/index.php?title=User_talk%3AESanders_%28WMF%29%2Fsandbox&type=revision&diff=20767250&oldid=20767248
The category doesn't move and the reply goes beneath the original comment.