TypeError: Bind parameters must not contain undefined. To pass SQL NULL specify JS null

TypeError: Bind parameters must not contain undefined. To pass SQL NULL specify JS null, at /var/www/agency/server/node_modules/mysql2/lib/connection.js:584:17, at Array.forEach (), at PoolConnection.execute (/var/www/agency/server/node_modules/mysql2/lib/connection.js:576:22), at /var/www/agency/server/node_modules/mysql2/promise.js:109:11, at new Promise (), at PromisePoolConnection.execute (/var/www/agency/server/node_modules/mysql2/promise.js:106:12), at queryDocumentAndParents (file:///var/www/agency/server/core/page-block-editor/query.js:25:31), at getDocumentAndParents (file:///var/www/agency/server/core/page-block-editor/get.js:24:27), at runMicrotasks (), at processTicksAndRejections (node:internal/process/task_queues:93:5), at async getDocument (file:///var/www/agency/server/core/page-block-editor/get.js:108:20), at async Object.default [as blocks] (file:///var/www/agency/server/website/controllers/blocks.js:43:26), at async runController (file:///var/www/agency/server/website/index.js:222:32), at async output (file:///var/www/agency/server/website/index.js:238:5), at async processRequest2 (file:///var/www/agency/server/website/index.js:194:5), at async processRequest (file:///var/www/agency/server/website/index.js:147:9)