Details about the bug:
The page at https://p5js.org/reference/#/p5/requestPointerLock notes that "not all browsers support this feature." It should also note, however, that the feature requires being called in a user callback (a click or something) in most browsers. Chrome definitely requires it, similar to audiocontext.