read_factory_settings makes all other operators call fail in a python script ran at startup
Separate into two scripts..
As commented by @scurest the read factory settings operator, naffs the contest, in this case context.window becoming None and throwing the error as shown.
Would either make a read_factory.py script
import bpy
bpy.ops.wm.read_factory_settings(use_empty=True) 

and with script as above (read factory settings commented out) (-P is equiv of --python)
blender -P read_factory.py -P load_ply.py

Opening a new file with just your imported ply mesh.  (Whereas starting with --factory-startup results in default startup objects and imported mesh)
For me the issue with doing this is my eyesight isn't what it used to be, and need everything a wee bit larger than default.
Another way would be to save an empty blank.blend  Could make your startup file blank.
blender -P load_ply.py blank.blend 

downside being if accidentally saved rather than save as is no longer blank.
Similar option is making a blank application template
New default file template?
(Note can add to your user config folder, eg on linux  ~/.config/blender/2.90/scripts/startup/bl_app_templates_user/blank/)
blender --app-template blank -P load_ply.py

other options commonly seen is removing or unlinking all collections / objects from scene / blend,
How to completely remove all loaded data from Blender?