Node version 20 works fine for webwork2. I have been using that with webwork2 for a while now. It is unlikely that downgrading to node 16 is what actually fixed the problem. Most likely running "npm ci" again in both the webwork2/htdocs and pg/htdocs locations and then restarting the webwork2 app would have fixed the problem without downgrading.
Installation
mathquill on 2.18
This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at 5 posting(s) in 1 day