I found the answer myself. Instead of
subplot(5,6,i,'position',[cl*bd+(cl-1)*ww (6-ln)*bd+(5-ln)*hh ww hh])
the subplot command should be:
h(i)=subplot('position',[cl*bd+(cl-1)*ww (6-ln)*bd+(5-ln)*hh ww hh]);
I had included the 5,6,i so I could easily address individual subplots using subplot(x,y) later but it seems that this syntax was not correct, although it did not produce any errors. So better to give each one a handle h(i) and address them later with axes(h(i)).
But maybe someone could still enlighten me why I ended up with such a bizarre result before.