You are missing the `ok` in the success path:
proc getValue(node: ValuesNode, key: Bytes32) : Result[Bytes32, string] =
if node.values[key[^1]] == nil:
err("Value not found")
else:
ok(cast[Bytes32](node.values[key[^1]]))
Run(took the liberty to remove the returns, but that is not necessary)
