Your Thread Title indicates the error occurs in the TextChanged event ... but I do Not get any error running your code with a mock layout ..
but then you say the error occurs when you add an item to the xCLV .
It might be easier to upload your project ... or a small sample demonstrating the problem.
also note ... if
pan1 is declared as B4XView then there is no need to re-declare the panel views if you are want to modify their properties ..
for example ...
Sub txtItemP_TextChanged (Old As String, New As String)
'Dim txt As EditText "not needed ... do not attempt to edit txt.Text or you will get error !
'txt = Sender
Dim index As Int = clv2.GetItemFromView(Sender) ' <------ I do NOT get the error on this line
Dim pnl As B4XView = clv2.GetPanel(index)
Dim pan1 As B4XView = pnl.GetView(0)
pan1.GetView(3).Text = "ABC"
pan1.GetView(6).Text = "123"
pan1.GetView(9).EditTextHint = "New Hint" 'unsure what you are planning to do with this edittext ?
End Sub