Hi,
When implemented in python, a forward/backward pair is defined by a Function. You can see here 12 in the doc how in details.
By default, if higher order derivatives are required, the autograd is applied to the backward function that is defined.
You can manually defined second derivatives by using 2 Functions, where the backward of the first one is simply calling the forward of the second one.
You also have a decorator @oncedifferentiable to notify the engine that a backward is implemented in a non differentiable manner. If you ask for second derivatives for such a function, the error you see is raised.
For the cpp implementations, most of them are not implemented in a differentiable manner hence the error you see.