I have two issues, one related to saving edits on a vector layer, the other related to the visibility of layers, and I'm assuming they have the same root cause, so I'm posting it as a single question. I think the issue arises at the project level, rather than the specific layer.
I have a complex QGIS 3 project with many layers. Recently I was editing a small hand-drawn vector path shapefile [EDIT: Actually it's a KML] (called Scouting_and_plans) and when I went to save edits I got this error:
Could not commit changes to layer Scouting_and_plans
Errors: ERROR: 1 geometries not changed.
Provider errors:
OGR error setting feature 41
I haven't found an explanation by Googling OGR error 41. I do seem to be able to edit some other vector layers in the project and save them normally.
As an attempted work-around, I exported the layer as a new layer. I tried both going to a new shapefile and a new geojson. In either case, I get what appears to be a layer with the appropriate data (attributes table works fine - also I can use the field calculator to get reasonable results), but there is no visible path. The path is not visible in the layers view on the left, nor on the actual map view, however if I edit the properties of the layer, all the settings appear normal - 100% opacity, some colored line with a reasonable stroke width.
I can still select paths normally, and the yellow selection color is applied - so the path is visible if selected. I can copy and paste a path to a new layer, and it is similarly selectable, highlightable, but not normally visible in the new layer.
If I create an empty project and add either the layer with the original issue, or the newly made layers, it functions normally, including for editing.
I have also opened the geojson file and looked at it in a text editor, and it appears normal.
I've re-loaded the project and restarted QGIS and the problem persists.
The feature I can edit but which returns an error when I save is in red (I moused over it with the vector editing tool for this screenshot to make it obvious.)