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.
We break from Trying To Access Array Offset On Value Of Type Null to share educational moment from old times:
Today is: 3rd July (GMT), in history on the 3rd of July, 1964 AD the following birth happened:
Louis Clark: NFL receiver (Seattle) / WLAF coach (Amsterdam Admirals)