Error: list index out of range

I think it is a bug as I tried to explain here :

Can you try the workaround to split long "if" statements into 2 smaller ones.