Late last year, I reported a problem with the CSD API when setting constraints between the protein file atoms (which include a cofactor) and the ligand (to be docked) atoms which is loaded as a separate molecule. After you guys were able to duplicate the problem, it was reported to be fixed.
see "distance constraint from fixed cofactor to substrate (ligand to be docked)" in the Discovery section of the forum, Nov 26, 2018.
I got side tracked with another project and now I'm back on the original project where I found the issue. The good news is that I can now set a distance constraint between the cofactor (included with the protein molecule) and the ligand (a separate molecule). The bad news is that even though it runs, the scores are all messed up as a result of the DE(con) having a value of -1777.79 for all poses:
Distance constraint from cofactor H, Coords(x=13.385, y=10.697, z=11.012), to ligand C, Coords(x=-8.597, y=3.842, z=0.108), range 2.0 to 5.0
rank file output data (a couple of rows):
Mol No Score S(PLP) S(hbond) S(cho) S(metal) DE(clash) DE(tors) DE(con) intcor time
4 -1728.75 -50.21 0.00 0.00 0.00 0.00 0.58 -1777.79 0.00 0.812
1 -1728.86 -47.31 0.99 0.00 0.00 0.00 0.68 -1777.79 0.00 0.000
The coordinates shown in the debug message are the original ones when the protein and ligand files are loaded. I printed them to make sure the right atoms were being passed to the constraint, and they are.
Everything works fine when the constraint is not set or all atoms in the constraint are in the protein file. You were able to duplicate the original problem, see original forum entry listed earlier, so hopefully you can use a similar approach to duplicate the scoring issue. BTW, setting a constraint from a protein residue atom to the ligand also has the same issue. I'm using Python API 2019 (same computer info as previous issue). Let me know if you need any additional information.