Hi @ptrblck ,
I managed to make a reproducible example in less than 25 lines 
import torch
import torch.nn as nn

#The same as my metropolis-hasting algorthim (albeit shorter)
x = torch.randn(4,2,requires_grad=True)
fc = nn.Linear(2, 1)
x.detach_().requires_grad_()

def _save_output(module, grad_input, grad_output) -> None:
  print("grad_output[0]: ",grad_output[0])

fc.register_full_backward_hook(_save_output)

with torch.no_grad():
  y = fc(x)

z = x.pow(2).sum(dim=-1)

#loss is defined as the sum of 2 terms
#first term, y has no gradient to it (purely scales)
#second term, z has a gradient. (in short, y scales z)
loss = torch.sum(y*z)

loss.backward()

when running this example, it returns,
Traceback (most recent call last):
  File "backward_hook_setup_error_standalone.py", line 15, in <module>
    y = fc(x)
  File "~/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1081, in _call_impl
    input = bw_hook.setup_input_hook(input)
  File "~/.local/lib/python3.8/site-packages/torch/utils/hooks.py", line 158, in setup_input_hook
    res, input_idx = self._apply_on_tensors(fn, args)
  File "~/.local/lib/python3.8/site-packages/torch/utils/hooks.py", line 142, in _apply_on_tensors
    raise RuntimeError("Error while setting up backward hooks. Please open "
RuntimeError: Error while setting up backward hooks. Please open an issue with a code sample to reproduce this.

Shall I open an issue with this?