<!-- This issue tracker is only for technical issues related to Bitcoin Core.

General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com.

For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/.

If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

<!-- Describe the issue -->

**Expected behavior**

When I make a json-rpc call to `getblock` with:

```json
{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getblock",
    "params": ["37351c7060ec3a149af1bbc9ebcc436c0ee652f96559ef1fe9bc45d11000f061", "2"]
}
```
An error should be returned with the [expected data type](https://developer.bitcoin.org/reference/rpc/getblock.html#argument-2-verbosity)(number) for `verbosity`.
<!--- What behavior did you expect? -->

**Actual behavior**

<!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

Received `"message": "JSON value is not a boolean as expected"` as an error message which is not the [expected data type](number) (https://developer.bitcoin.org/reference/rpc/getblock.html#argument-2-verbosity) for `verbosity`

**To reproduce**

Use this curl on a node

```
curl --location --request POST "127.0.0.1:8332" \
--header "Content-Type: application/json" \
--header "Authorization: Basic YOUR_AUTH" \
--data "{
    \"jsonrpc\": \"1.0\",
    \"id\": \"curltest\",
    \"method\": \"getblock\",
    \"params\": [\"37351c7060ec3a149af1bbc9ebcc436c0ee652f96559ef1fe9bc45d11000f061\", \"2\"]
}"
```

**System information**
* self-compiled

<!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

<!-- GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->

<!-- Any extra information that might be useful in the debugging process. -->
<!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

{RPCResult::Type::NUM, "height", "The height of the block"},
                {RPCResult::Type::NUM, "ins", "The number of inputs (excluding coinbase)"},
                {RPCResult::Type::NUM, "maxfee", "Maximum fee in the block"},
                {RPCResult::Type::NUM, "maxfeerate", "Maximum feerate (in satoshis per virtual byte)"},
                {RPCResult::Type::NUM, "maxtxsize", "Maximum transaction size"},
                {RPCResult::Type::NUM, "medianfee", "Truncated median fee in the block"},
                {RPCResult::Type::NUM, "mediantime", "The block median time past"},
                {RPCResult::Type::NUM, "mediantxsize", "Truncated median transaction size"},
                {RPCResult::Type::NUM, "minfee", "Minimum fee in the block"},
                {RPCResult::Type::NUM, "minfeerate", "Minimum feerate (in satoshis per virtual byte)"},
                {RPCResult::Type::NUM, "mintxsize", "Minimum transaction size"},
                {RPCResult::Type::NUM, "outs", "The number of outputs"},
                {RPCResult::Type::NUM, "subsidy", "The block subsidy"},
                {RPCResult::Type::NUM, "swtotal_size", "Total size of all segwit transactions"},
                {RPCResult::Type::NUM, "swtotal_weight", "Total weight of all segwit transactions"},
                {RPCResult::Type::NUM, "swtxs", "The number of segwit transactions"},
                {RPCResult::Type::NUM, "time", "The block time"},
                {RPCResult::Type::NUM, "total_out", "Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee])"},
                {RPCResult::Type::NUM, "total_size", "Total size of all non-coinbase transactions"},
                {RPCResult::Type::NUM, "total_weight", "Total weight of all non-coinbase transactions"},
                {RPCResult::Type::NUM, "totalfee", "The fee total"},
                {RPCResult::Type::NUM, "txs", "The number of transactions (including coinbase)"},
                {RPCResult::Type::NUM, "utxo_increase", "The increase/decrease in the number of unspent outputs"},
                {RPCResult::Type::NUM, "utxo_size_inc", "The increase/decrease in size for the utxo index (not discounting op_return and similar)"},
            }},
                RPCExamples{
                    HelpExampleCli("getblockstats", R"('"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"' '["minfeerate","avgfeerate"]')") +
                    HelpExampleCli("getblockstats", R"(1000 '["minfeerate","avgfeerate"]')") +
                    HelpExampleRpc("getblockstats", R"("00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", ["minfeerate","avgfeerate"])") +
                    HelpExampleRpc("getblockstats", R"(1000, ["minfeerate","avgfeerate"])")