$ gh codeql list-versions
expected an object but got: string ("https://docs.github.com/rest")
I haven't investigated, but perhaps this is making an invalid API request.
EDIT: The reason for the error was an expired PAT. Leaving this issue open so we can provide a better error message in this case.