The help text on the getblockchaininfo RPC states
getblockchaininfo
Returns an object containing various state info regarding blockchain processing.
Result:
{
"blocks": the current number of blocks processed in the server
"headers": the current number of headers we have validated
...
}
However, for both blocks and headers it returns the current height, i.e. #blocks+1.
This can be especially confusing on regtest when working with small block numbers.