the command "bitcoin-cli getblockstats 0000000000000000000c61ff8f761ce509fc8901d3c22d61fec89637042ea2ba" does not work.

It displays "error: Error parsing JSON:0000000000000000000c61ff8f761ce509fc8901d3c22d61fec89637042ea2ba"

but it should display the block stats like the documentation says.

also bitcoin-cli getblockstats 0 does not work. block number must be at least 1 to work. But blocks start at 0.

tested with 0.20.1 on freebsd, another user on IRC acknowledged the problem.
{
    
    if (!DeploymentEnabled(chainman, id)) return;
    if (blockindex == nullptr) return;
    auto get_state_name = [](const ThresholdState state) -> std::string {
        switch (state) {
        case ThresholdState::DEFINED: return "defined";
        case ThresholdState::STARTED: return "started";
        case ThresholdState::LOCKED_IN: return "locked_in";
        case ThresholdState::ACTIVE: return "active";
        case ThresholdState::FAILED: return "failed";
        }
        return "invalid";
    };
    UniValue bip9(UniValue::VOBJ);
    const ThresholdState next_state = chainman.m_versionbitscache.State(blockindex, chainman.GetConsensus(), id);
    const ThresholdState current_state = chainman.m_versionbitscache.State(blockindex->pprev, chainman.GetConsensus(), id);
    const bool has_signal = (ThresholdState::STARTED == current_state || ThresholdState::LOCKED_IN == current_state);
    
    if (has_signal) {
        bip9.pushKV("bit", chainman.GetConsensus().vDeployments[id].bit);
    }
    bip9.pushKV("start_time", chainman.GetConsensus().vDeployments[id].nStartTime);
    bip9.pushKV("timeout", chainman.GetConsensus().vDeployments[id].nTimeout);
    bip9.pushKV("min_activation_height", chainman.GetConsensus().vDeployments[id].min_activation_height);
    
    bip9.pushKV("status", get_state_name(current_state));
    bip9.pushKV("since", chainman.m_versionbitscache.StateSinceHeight(blockindex->pprev, chainman.GetConsensus(), id));
    bip9.pushKV("status_next", get_state_name(next_state));