zip is for attaching elements of different collections together. That would be necessary in languages where the indices have to be kept in separate arrays by themselves.
Since Julia has CartesianIndex type to store the indices together in a single object, aij doesn’t need to be zipped. What you need is to instead turn it into a Tuple so it can be separated out into x and y here. The above is one way to do it, but the following:
for a in aij
x, y = Tuple(a)
maybe a bit more effiient in case aij contains a lot of values.
(Using either of these instead of for (x, y) in zip(aij) would get rid of the bounds error issue as well.)