In Distirbutions 0.25.119, there was a breaking change where cov() and invcov() return PDMat instead of Matrix. This is the PR from Distributions.jl: JuliaStats/Distributions.jl#1373 that was integrated in v0.25.119.
For efficiency, the code should be restructured to not require the Matrix type, but for ease of fixing, we can wrap the outputs with Matrix or require <0.25.119 in the compact options.