1. Don't use toast messages for debugging. Use Log instead.
2. The Try / Catch blocks are not needed and will only make it more difficult to fix the problem.
A custom view class is never a view by itself.
Unfortunately the base view of B4XSwitch is not public. I will change it for a future version.
You can instead do something like:
'when you create the item layout
Panel1.LoadLayout(...)
B4XSwitch1.Tag = Panel1
You can then use it with:
Sub BtnSchedEnable_ValueChanged (Value As Boolean)
Dim sw As B4XSwitch = Sender
Dim MyIndex As Int =CLVPoolTC.GetItemFromView(sw.Tag)