import bpy
s=bpy.context.scene
# make a second camera at origin and render to test
camd=bpy.data.cameras.new('TestCam'); cam=bpy.data.objects.new('TestCam',camd); s.collection.objects.link(cam); cam.location=(0,-10,3); cam.rotation_euler=(0,0,0); # wrong point
s.camera=cam
s.render.engine='BLENDER_WORKBENCH'; s.render.resolution_x=256;s.render.resolution_y=256;s.render.resolution_percentage=100
try:
    bpy.ops.render.render()
    result={'size':tuple(bpy.data.images['Render Result'].size),'testcam':tuple(cam.location)}
except Exception as e: result={'err':str(e)}
# restore presentation and remove test
s.camera=bpy.data.objects.get('Presentation Camera'); bpy.data.objects.remove(cam,do_unlink=True); bpy.data.cameras.remove(camd)