When working with a vendor to debug their kernel module, I found that a non-tied kld will panic due to "namei: bad debugflags " on a kernel compiled with INVARIANTS because non-tied KLDs do not pick up the initialization that is done in NDINIT_DBG/NDREINIT_DBG().
Fix this by making this initialization happen for non- KLD_TIED as well as INVARIANTS