I’m documenting this in case it helps someone in future.
I was getting this error when trying to save a 2D geometry in RAS Mapper:
Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue.
If you click Quit, the application will close immediately.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index.
Eventually I realised that some of my breaklines weren’t applying when I tried to apply all breaklines at once, or a group of selected breaklines. I had to check them all and apply them individually if necessary, then the geometry was able to save.