Fixed error message for scan op dimension mismatch

The error message when the scan op has a dimension mismatch prints a dimension which is 1 higher than the dimension compared, which results in cryptic errors such as:

```
The initial state (outputs_info in scan nomenclature) of variable X (argument number 0) has dtype float32 and 3 dimension(s), while the result of the inner function for this output has dtype float32 and 3 dimension(s).
```