I found workaround for this bug:
In c++ create function and call MarkRenderStateDirty() on your mesh component (after SetRenderCustomDepth()).
Example:
lMeshComponent->SetRenderCustomDepth(InEnable);
lMeshComponent->SetCustomDepthStencilValue(InStencilValue);
lMeshComponent->MarkRenderStateDirty();
I found out that in 4.15 MarkRenderStateDirty was called everytime in SetRenderCustomDepth(), but why epic changed that?