There was a similar thread a few years ago regarding the UI version of TMPro.
It looks like the issue was never resolved for the non-UI version of TMPro.
I think it has something to do with the character count of the text. It seems like the TextInfo is only repopulated when TextMeshPro.text is assigned a string that is longer than the previous one.
Workaround
Clearing TextInfo.wordInfo resolves the issue.
TextMeshPro tm;
...
tm.textInfo.wordInfo = new TMP_WordInfo[0];
tm.text = yourString;
tm.ForceMeshUpdate(true, true);