Yeah, it was all about isolating the source of the problem.
in p5.js Mode, when you click the Run button, the job gets handed over to the browser. Then it is up to the browser to read the HTML, and render the page and manage the JavaScript console, according to the linked p5.js library, the linked sketch script, and any CSS that might be linked in or embedded. So, at that stage it becomes unlikely the the problem is with the Processing IDE itself. That sends our focus to the browser or the code for the source of the problem. The code looks good, so that leaves the browser, including its settings.
EDITED on January 17, 2022 to add a couple of sentences to the above.