I must admit I hadn't noticed that option before :)
I'm not sure whether the current version of QGIS uses it for intermediate files, or just output files - it may use memory layers now. In either case, the principle is the same.
As you say, geojson has an advantage over shapefile - there's no need to truncate ("launder") field names.
The reason you might be getting errors changing the result, is that the geojson driver doesn't allow in-place edits. You can read an existing geojson file, create a new one, but you can't edit an existing one.
The same goes for rasters; some file types can't be written, only read.
The following code was cribbed from the Python GDAL/OGR cookbook
from osgeo import ogr
ds = ogr.Open("/path/to/some.geojson",0)
layer = ds.GetLayer()
capabilities = [
ogr.OLCRandomRead,
ogr.OLCSequentialWrite,
ogr.OLCRandomWrite,
ogr.OLCFastSpatialFilter,
ogr.OLCFastFeatureCount,
ogr.OLCFastGetExtent,
ogr.OLCCreateField,
ogr.OLCDeleteField,
ogr.OLCReorderFields,
ogr.OLCAlterFieldDefn,
ogr.OLCTransactions,
ogr.OLCDeleteFeature,
ogr.OLCFastSetNextByIndex,
ogr.OLCStringsAsUTF8,
ogr.OLCIgnoreFields
]
print("Layer Capabilities:")
for cap in capabilities:
print(" %s = %s" % (cap, layer.TestCapability(cap)))
The output for one geojson file is
Layer Capabilities:
RandomRead = True
SequentialWrite = False
RandomWrite = False
FastSpatialFilter = False
FastFeatureCount = True
FastGetExtent = False
CreateField = False
DeleteField = False
ReorderFields = False
AlterFieldDefn = False
Transactions = False
DeleteFeature = False
FastSetNextByIndex = True
StringsAsUTF8 = True
IgnoreFields = False
From that, you can see GeoJSON files don't allow editing, and don't have their own spatial indexes. This page describes these capabilities in more detail.
You don't need code for this if you have a layer; right-click on a layer, properties, metadata and scroll down to "capabilities for this layer".
It's also possible that some formats may only support some geometry types... there may be restrictions on 25D, Curves etc. The formats available may depend on the version of QGIS and/or GDAL/OGR installed.
Which format to use depends on your specific requirements. I suspect that shp, sqlite and gpkg are probably the most flexible if you want to do further processing.