When implementing a custom object (derived from AcDbObject or AcDbEntity) the dwgOutFields method is required, otherwise AutoCAD will not save our data. Usually the first step is call the base implementation, but that can crash. Why?
One reason is the safe check implemented to avoid null or erased AcDbDictionary referenced by the object, basically a isNull and isErased check.
Remember to configure and enable AutoCAD Debug Symbols on Visual Studio, that will help spot problems on internal calls.