The biggest challenge by far is portability, SQLite, like NetBSD, runs on toasters.
A look at the CVE list reveals that there were some CVEs with read freed memory or array overflows. That said the amount of CVEs is comparatively tiny to other software, so as you said, it really shows that they put incredible amounts of efforts into safety and correctness. Still, there would probably still be some value to it, even if very minimal (is it worth it though?)
My impression is that compilers are probably among the easiest software to port because they rely heavily on E2E tests, have large test suites, and have inputs that are relatively well specified.
Keeping an extensive suite of tests private is just an artificial way to boost the trust in the team. It's an interesting way for open-source developers to have their cake and eat it too.
I think it is either going to be this or open core for OSS going forward.