I’ve found the issue and will leave it for people more familiar with the DFT infrastructure than I to fix. As a workaround, explicitly supply set reference rks before calling c1_deep_copy on an RKS DFT wavefunction object.
You’re right. I was looking at wfn and not hf_wfn in the C++ code.
It looks like I may have misunderstood the purpose of c1_deep_copy(). I thought it would strip the symmetry from the basis but it seems it simply copies a few arrays. Anyway, setting the reference to ‘rks’ seems to fix the problem. Which is weird because the rest of the code worked fine with ‘rhf’.