How to solve "the leading minor of order # is not positive definite"?

See Ben Bolker's answer for another reason this might arise. Without finaldata, it's not possible to test whether this is the case here. See the FAQ: How to do a minimal reproducible example reprex for beginners.