looks like you’re trying to make it work in-place. and it might have trouble with that.
let it return a new UMat or provide a separate UMat for the result.
if that fixes it, I’d say in-place is the issue. in that case, you should check for existing issues and maybe submit one about this.
make sure that this is reproducible on the latest release, 4.10.