The error you may get with PHP 7.4+:
"Trying to access array offset on value of type null"
May have to do with attempting to insert a result that contains no data.
Either make sure what you are inserting is not null or in the database make the field null.
Since PHP 7.4 this seems to be explicit and error message will abound if you don't give a reference statement for variables.