Saving two shapefiles into one GeoJSON
GeoJSON can have only one layer.
https://tools.ietf.org/html/rfc7946#section-2
- GeoJSON Text
A GeoJSON text is a JSON text and consists of a single GeoJSON object.
- GeoJSON Object
A GeoJSON object represents a Geometry, Feature, or collection of Features.
For GDAL and QGIS this means https://gdal.org/drivers/vector/geojson.html
A GeoJSON datasource is translated to single OGRLayer object with pre-defined name OGRGeoJSON:
ogrinfo -ro http://featureserver/data/.geojson OGRGeoJSON
It is also valid to assume that OGRDataSource::GetLayerCount() for GeoJSON datasource always returns 1.