Here is a minimal example that raises an error for me. My pytorch version is 1.3.1.
import torch

a = torch.tensor([1., 2., 3.], requires_grad=True)
b = torch.tensor([5., 5., 5.], requires_grad=True)

c = torch.dot(a, b)

projection = torch.ones_like(c, requires_grad=True)
intermediate = torch.autograd.grad(
    c, 
    a, 
    projection
)

d = torch.tensor([2., 2., 2.], requires_grad=True)

d_dot_b = torch.autograd.grad(
    intermediate, 
    projection,
    d
)

The error I get is
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-41-81219a2d5296> in <module>
     16     intermediate,
     17     projection,
---> 18     d
     19 )

~/miniconda3/envs/lottery-tickets/lib/python3.6/site-packages/torch/autograd/__init__.py in grad(outputs, inputs, grad_outputs, retain_graph, create_graph, only_inputs, allow_unused)
    155     return Variable._execution_engine.run_backward(
    156         outputs, grad_outputs, retain_graph, create_graph,
--> 157         inputs, allow_unused)
    158 
    159 

RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn

On the other hand, the following runs fine for me and gives the expected output
import torch

a = torch.tensor([1., 2., 3.], requires_grad=True)
b = torch.tensor([5., 5., 5.], requires_grad=True)

c = torch.dot(a, b)

projection = torch.ones_like(c, requires_grad=True)
intermediate = torch.autograd.grad(
    c, 
    a, 
    projection
    create_graph=True  # <<<<< the only change
)

d = torch.tensor([2., 2., 2.], requires_grad=True)

d_dot_b = torch.autograd.grad(
    intermediate, 
    projection,
    d
)

This is almost certainly due to my misunderstanding something/lack of knowledge, thanks for your help and attention in clearing it up!