The problem here seems to be the 0.9.6 DBAPI calling $modx functions, this creates a dependency and as such, if one fails, they both will. I think the best solution would be to completely abstract DBAPI away from its reliance on any other class.
I believe DBAPI should be "smart" enough to detect when the db connection fails and then fallback to filesystem logging, it would allow a somewhat graceful degradation and we’d be able to capture the last error that came up before MODx keeled over
Perhaps some inspiration could come from the xPDO logging system?