Unfortunately, createCanvas() instantiates a p5.Renderer object, while createGraphics() instantiates a p5.Graphics object, which is a wrapper for a p5.Renderer object, plus it acts as a p5 object too:
It’s very inconsistent & hard to study how the p5js API deals w/ those 2 classes across its source code!
There are other problematic patches to deal w/ p5.Image objects too.
For some reason, the class p5.Image doesn’t inherit from p5.Element!
And therefore, it’s not a parent class for neither p5.Renderer nor p5.Graphics!
BtW, I’ve always ranted & been against this hackish p5.Graphics class from the very beginning of the p5js project.