maybe something like: your canvas is set to an initial size and then a smaller SVG is drawn inside it. When that's saved for display the resulting .png isn't the same size as the canvas so the browser moves things around a little?
What would happen if you started your SVG output by drawing a canvas-dimensioned border?
What would happen if you started your SVG output by drawing a canvas-dimensioned border?