I am getting some inconsistent results with composite. Perhaps I misunderstand.
#This works as expected and produces the correct result for tmp3a.png
convert -size 20x360 gradient: -rotate 90 tmp1a.png

convert -size 20x20 xc:red -background none -gravity east -extent 360x20 tmp2a.png

convert tmp1a.png tmp2a.png -compose over -composite tmp3a.png

#This does not produce the correct final result for tmp3b.png. It is mostly black rather than mostly gradient.
convert -size 20x360 gradient: -rotate 90 tmp1b.png

convert -size 20x20 xc:gray -background none -gravity east -extent 360x20 tmp2b.png

convert tmp1b.png tmp2b.png -compose over -composite tmp3b.png

Is this a bug, or am I misunderstanding or missing something here?