Hello there,
As you are using this script for long time try checking for any latest change in the device like an windows update which might have changed the rights within the device.
The error usually occurs if you are not passing right parameters with New-PowerBIReport command.
Instead of using the .Process() method on the database object, you need to use the .RequestRefresh() (with the appropriately refresh type) against the model object, then the .SaveChanges() method to send the command.
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer--