I've done a quick comparison on a working installation on PHP8.2 and I notice in your file there's no inclusion of the rsobj.php file - I wonder if that's what the issue is?
In my file, I have it just after the Connection file:
<?php
require_once("../Connections/PowerCMSConnection.php");
?>
<?php
require_once("../webassist/mysqli/rsobj.php");
?>
My file hasn't been updated since 2019 though, so doesn't look like I had to change anything when I upgraded from php5 as it was after 2019. I've attached my file for reference, but you could maybe try adding the rsobj.php include to your file and see if that makes a difference?