Python, 3938 bytes
def f(a,x):f(a[1:print(a.index(x));f(a[1:],x)
Attempt This Online!Attempt This Online!
Finishes with an exception
-5 bytes thanks to AnttiP
-1 thanks to dingledooper
Whython, 4140 bytes
def f(a,x):f(a[1:print(a.index(x))+f(a[1:],x)?0
Attempt This Online!Attempt This Online!
No error