I think it is a bug;
At that line the commands are;
MazeImage = GetImage(0, 0, ScopeSize, ScopeSize)
MapSprite = CreateSprite(MazeImage)
SetSpritePosition(MapSprite, X0, Y0)
SetSpriteDepth(MapSprite, 11)
SetSpriteVisible(CircleMask, _TRUE_)
SetSpriteVisible(AlphaMask, _TRUE_)
I've nothing to do with setrawwritepath at that point.
rendering to an image
getting mazeimage, creating a sprite with it, rendering it and then deleting it to reuse it.
Actually, i wish drawn boxes could be behinde the sprites, their depths also could be adjusted.
Anyways, probably a bug with the error system I guess...