Running Script and rendering from command line with external script
You are running blender twice, the first time it opens the file and runs your script then it closes the file and quits. The second time it opens the file and renders the animation. Without saving the blend file in the first run, the render step will start with the same data as before the script was run.

Blender processes command line arguments in order given, that is you can do it in one step by running the script and then rendering.

blender -b oop-blender-demo.blend -P model.py -a


Another option is to have the script do the rendering by adding

bpy.ops.render.render(animation=True)


Using save_as_mainfile() you would want to give it a filepath parameter. The save as operator saves a copy of the current blend file using the filepath parameter, without it you can't be sure where the copy is saved. If it did work, you will want to open the saved copy to render rather then the same original file. Normal system security settings are in effect, so the inability to save a file may come from the system preventing you from writing to the current directory or path .

Instead of saving a copy of the file you may want to use bpy.ops.wm.save_mainfile() which does a normal save of the current file rather than saving a copy.