I originally raised this in ocaml/ocaml-lsp#1543 (more details and example in that issue) but it was pointed offline by @xvw that the problem may lie in merlin.
I would be happy to work on this but would appreciate any pointers to where the problem may lie.