it's not so much canvas not working as it's Processing.js not looking for DOM insertions for canvas to load sketches; it only does a general pass for sketches to load on DOM content loaded. Since you want your sketch injected after that, you can either trigger a reparse (by calling Processing.reload(), which will reset everything, so if you have other sketches on the same page that should not be reset, don't use that) or you can call
var sourceList = ['file1.pde','file2.pde','...',...];
var canvas = document.querySelector("#mycanvas");
Processing.loadSketchFromSources(canvas, sourceList);
specifically for the one sketch whenever it's safe to inject it into the page.