Well if you want gradients, you might want to double check that.
In particular, you will need to remove the detach at the beginning and make sure they require gradients.
Also remove the detach in the last grad and add a create_grad=True
The following should work:
import torch
from torch import autograd

def f(x):
    return 2 + x**4 + x[0] ** 5

def get_loss_fast(x, v):
    y = f(x)
    grad_x = autograd.grad(y, x, v, create_graph=True)[0]
    vjp_val = grad_x

    jvp_val = autograd.grad(grad_x, v, v, create_graph=True)[0]

    return (vjp_val - jvp_val).norm(1)

inp = (torch.rand(2, dtype=torch.double, requires_grad=True), torch.rand(2, dtype=torch.double, requires_grad=True))
print(autograd.gradcheck(get_loss_fast, inp))

get_loss_fast(*inp).backward()
print(inp[0].grad)
print(inp[1].grad)