I think you were running into fontSize not being updated when text is scaled - you need to look at the scaleX and scaleY from the query, and then use the scale as input when creating a new text element.
I wrote a new community article that should answer the questions you might have:
Please let me know if you have any other questions.