Yes I tried to add the "content size fitter" to the STM object but it seems not to work properly...
And I made a simple example of this case and hope this could help to figure out the problem.
Here is my ui setting:
I also recorded the video of "STM Sample"(use STM text) and "Default Text Sample"(use unity default text).
(The STM version I used in this sample is 1.12.0, and I comment out the rect update in Editor mode to make sure it works as the build.)
And the result I want is as the demo of "Default Text".
sample video download link(available in 7 days, unzip pw:stm): https://firestorage.jp/download/87217ba5b9b682fa109a2f8eae240cabdc6a2406