Edit - It was my doubt/question earlier, but I can't delete it so adding my findings in the description.
Feel free to reply if my findings lack anything.
We can only use ChangeCompany function for Record type and RecordRef type.
If you want to run other objects like reports, codeunits, etc in the partner company using change company, you will need to create a Job Queue via AL Code and pass the codeunit or report that you want to run. This will allow you to run the report or codeunit in other companies.
In practice, using ChangeCompany
is typically only safe for reading data across companies. Writing or posting with it often leads to subtle bugs or data inconsistencies. Creating APIs for these kinda tasks is more preferrable.