Finally figured out that I needed to register the custom op without a domain namespace (I’m not sure if that’s strictly the right term) and it was recognised and replaced it correctly. I was trying things like torch::, functional:: or _VariableFunctions:: before and was uncertain if it was just the name I didn’t know or it wasn’t possible.
def grid_sample_op(g, input1, input2, mode, padding_mode, align_corners):
    return g.op("torch::grid_sampler", input1, input2, mode, padding_mode, align_corners)

torch.onnx.register_custom_op_symbolic('::grid_sampler', grid_sample_op, 11)