Context overriding in Blender 3.2 and later
In the Blender Python API, some operators can only be called in the area they are intended for. If we call such an operator in another area, it will not be executed or Blender will throw an error. To call a context-related operator from an area not intended for it, we need to redefine the context.