The previous code was assuming the instruction index and the program_id index were the same. That's always true for single-instruction transactions, but not for multiples.
The previous code was assuming the instruction index and the program_id index were the same. That's always true for single-instruction transactions, but not for multiples.