Instance mode creating two canvas

Did you try the example form from the instance mode documentation? (untested)

const s = ( sketch ) => {
  // ...
};

let myp5 = new p5(s);