The -reindex option is broken on both the master branch and the 29.x branch (I have not tested older release branches).
Consider the following workflow on OpenBSD 7.7:
$ rm -rf /home/hebasto/.bitcoin/regtest
$ ./build/bin/bitcoind -regtest -daemon
Bitcoin Core starting
$ ./build/bin/bitcoin-cli -regtest createwallet $(date +%Y-%m-%d)
$ ./build/bin/bitcoin-cli -regtest -generate 200
$ ./build/bin/bitcoin-cli -regtest getblockcount
200
$ ./build/bin/bitcoin-cli -regtest stop
Bitcoin Core stopping
$ rm -rf /home/hebasto/.bitcoin/regtest/blocks/index
$ ./build/bin/bitcoind -regtest -daemon
Bitcoin Core starting
$ tail -6 /home/hebasto/.bitcoin/regtest/debug.log
2025-08-02T15:02:00Z : Error initializing block database.
Please restart with -reindex or -reindex-chainstate to recover.
2025-08-02T15:02:00Z Shutdown: In progress...
2025-08-02T15:02:00Z scheduler thread exit
2025-08-02T15:02:00Z Flushed fee estimates to fee_estimates.dat.
2025-08-02T15:02:00Z Shutdown: done
$ rm /home/hebasto/.bitcoin/regtest/debug.log
$ ./build/bin/bitcoind -regtest -daemon -reindex
Bitcoin Core starting
$ ./build/bin/bitcoin-cli -regtest getblockcount
0
$ cat /home/hebasto/.bitcoin/regtest/debug.log
2025-08-02T15:13:08Z Bitcoin Core version v29.99.0-75ed673193c5 (release build)
2025-08-02T15:13:08Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
2025-08-02T15:13:08Z Using RdSeed as an additional entropy source
2025-08-02T15:13:08Z Using RdRand as an additional entropy source
2025-08-02T15:13:08Z Default data directory /home/hebasto/.bitcoin
2025-08-02T15:13:08Z Using data directory /home/hebasto/.bitcoin/regtest
2025-08-02T15:13:08Z Config file: /home/hebasto/.bitcoin/bitcoin.conf (not found, skipping)
2025-08-02T15:13:08Z Command-line arg: daemon=""
2025-08-02T15:13:08Z Command-line arg: regtest=""
2025-08-02T15:13:08Z Command-line arg: reindex=""
2025-08-02T15:13:08Z Using at most 125 automatic connections (512 file descriptors available)
2025-08-02T15:13:08Z scheduler thread start
2025-08-02T15:13:08Z Binding RPC on address ::1 port 18443
2025-08-02T15:13:08Z Binding RPC on address 127.0.0.1 port 18443
2025-08-02T15:13:08Z Generated RPC authentication cookie /home/hebasto/.bitcoin/regtest/.cookie
2025-08-02T15:13:08Z Permissions used for cookie: rw-------
2025-08-02T15:13:08Z Using random cookie authentication.
2025-08-02T15:13:08Z Starting HTTP server with 16 worker threads
2025-08-02T15:13:08Z Using wallet directory /home/hebasto/.bitcoin/regtest/wallets
2025-08-02T15:13:08Z init message: Verifying wallet(s)…
2025-08-02T15:13:08Z Using /16 prefix for IP bucketing
2025-08-02T15:13:08Z init message: Loading P2P addresses…
2025-08-02T15:13:08Z Loaded 0 addresses from peers.dat 0ms
2025-08-02T15:13:08Z init message: Loading banlist…
2025-08-02T15:13:08Z SetNetworkActive: true
2025-08-02T15:13:08Z Cache configuration:
2025-08-02T15:13:08Z * Using 2.0 MiB for block index database
2025-08-02T15:13:08Z * Using 8.0 MiB for chain state database
2025-08-02T15:13:08Z * Using 440.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
2025-08-02T15:13:08Z Script verification uses 7 additional threads
2025-08-02T15:13:08Z Using obfuscation key for blocksdir *.dat files (/home/hebasto/.bitcoin/regtest/blocks): '997651b2ed068218'
2025-08-02T15:13:08Z Wiping LevelDB in /home/hebasto/.bitcoin/regtest/blocks/index
2025-08-02T15:13:08Z Opening LevelDB in /home/hebasto/.bitcoin/regtest/blocks/index
2025-08-02T15:13:08Z Opened LevelDB successfully
2025-08-02T15:13:08Z Using obfuscation key for /home/hebasto/.bitcoin/regtest/blocks/index: 0000000000000000
2025-08-02T15:13:08Z Using 16 MiB out of 16 MiB requested for signature cache, able to store 524288 elements
2025-08-02T15:13:08Z Using 16 MiB out of 16 MiB requested for script execution cache, able to store 524288 elements
2025-08-02T15:13:08Z init message: Loading block index…
2025-08-02T15:13:08Z Validating signatures for all blocks.
2025-08-02T15:13:08Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
2025-08-02T15:13:08Z Initializing chainstate Chainstate [ibd] @ height -1 (null)
2025-08-02T15:13:08Z Wiping LevelDB in /home/hebasto/.bitcoin/regtest/chainstate
2025-08-02T15:13:08Z Opening LevelDB in /home/hebasto/.bitcoin/regtest/chainstate
2025-08-02T15:13:08Z Opened LevelDB successfully
2025-08-02T15:13:08Z Wrote new obfuscation key for /home/hebasto/.bitcoin/regtest/chainstate: cc8a83834d10b91a
2025-08-02T15:13:08Z Using obfuscation key for /home/hebasto/.bitcoin/regtest/chainstate: cc8a83834d10b91a
2025-08-02T15:13:08Z init message: Verifying blocks…
2025-08-02T15:13:08Z Block index and chainstate loaded
2025-08-02T15:13:08Z Setting NODE_NETWORK on non-prune mode
2025-08-02T15:13:08Z initload thread start
2025-08-02T15:13:08Z Reindexing block file blk00000.dat...
2025-08-02T15:13:08Z UpdateTip: new best=0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206 height=0 version=0x00000001 log2_work=1.000000 tx=1 date='2011-02-02T23:16:42Z' progress=0.000002 cache=0.3MiB(0txo)
2025-08-02T15:13:08Z block tree size = 1
2025-08-02T15:13:08Z nBestHeight = 0
2025-08-02T15:13:08Z mapport thread start
2025-08-02T15:13:08Z torcontrol thread start
2025-08-02T15:13:08Z Bound to 127.0.0.1:18445
2025-08-02T15:13:08Z Bound to [::]:18444
2025-08-02T15:13:08Z Bound to 0.0.0.0:18444
2025-08-02T15:13:08Z Loaded 0 addresses from "anchors.dat"
2025-08-02T15:13:08Z 0 block-relay-only anchors will be tried for connections.
2025-08-02T15:13:08Z init message: Starting network threads…
2025-08-02T15:13:08Z net thread start
2025-08-02T15:13:08Z dnsseed thread start
2025-08-02T15:13:08Z Loading addresses from DNS seed dummySeed.invalid.
2025-08-02T15:13:08Z addcon thread start
2025-08-02T15:13:08Z opencon thread start
2025-08-02T15:13:08Z init message: Done loading
2025-08-02T15:13:08Z msghand thread start
2025-08-02T15:13:08Z 0 addresses found from DNS seeds
2025-08-02T15:13:08Z dnsseed thread exit
2025-08-02T15:13:08Z Loaded 1 blocks from external file in 38ms
2025-08-02T15:13:08Z Reindexing finished
2025-08-02T15:13:08Z Loading 0 mempool transactions from file...
2025-08-02T15:13:08Z Imported mempool transactions from file: 0 succeeded, 0 failed, 0 expired, 0 already there, 0 waiting for initial broadcast
2025-08-02T15:13:08Z initload thread exit
$ ./build/bin/bitcoin-cli -regtest stop
Bitcoin Core stopping
Despite the log containing the messages "Reindexing block file blk00000.dat..." and "Reindexing finished", the getblockcount RPC returns 0.
It appears this issue affects other operating systems as well, as noted in #32987 (review).