By default (and this is the recommended and correct behavior) all transactions with fragments occur asynchronously. Therefore, after calling commit at the transaction for adding a fragment, it is not added instantly and when you try to access it, it will not be in the activation stack in the activated state yet.
You need to alter the logic of changing the text in the fragment, taking into account this behavior. In principle, trying to touch the fragment markup directly is a bad practice.
Depending on why you change the text in the fragment, you can go in different ways.
If you just need to set the text once for the fragment, transfer the data to the fragment when it is created through Fragment#setArguments(Bundle args) and then drag it into the fragment in the onCreate method through Fragment#getArguments() and set the text in the TextView in the onCreateView method of the fragment .
If you need to change something by pressing a button, for example, or by setting another event, then you need to create a method in the fragment that will change the text in the text field and call this method from the activation, after receiving the fragment from FragmentManager , checking that the fragment is in the active state ( Fragment#isAdded() == true ) in order not to run into the situation of its detachment from the activation.
If you want to call the rows completely one by one and expect that the fragment will be added synchronously and you can immediately refer to its markup, you can try commitNow() instead of commit() in the transaction of adding a fragment. In theory, this will give the desired effect. But no one knows for sure, because to do so is very bad and wrong and we never do it, so it may not work.