The text gets actually updated the tick after the action happened.
So as you noticed, you can only get the textheight a tick after a new text is updated in a text object.
I guess it has to do with the fact that the text object is handled out of the canvas in a separate layer.
it's not a "true"/belonging part of your application.