The problem is not that .typeText(_:)
doesn't work, it's that your query doesn't resolve to an element.
It can sometimes seem like the query is not working properly when the view you're trying to find is inside an accessible container view of some sort. You can mitigate this by explicitly disabling accessibility in the container view.
Set the stack view that contains the text view to not be an accessibility element and then set an accessibility identifier on the text view.
// app code
let stack: UIStackView!
let textView: UITextView!
stack.isAccessibilityElement = false
textView.isAccessibilityElement = true
textView.accessibilityIdentifier = "myTextView"
// test code
let app = XCUIApplication()
let textView = app.textViews["myTextView"]
textView.typeText("something")