The CHECK_NONFATAL check here may fail when getblocktemplate is called during shutdown or during startup.
0rpc/mining.cpp:875 auto getblocktemplate()::(anonymous class)::operator()(const RPCHelpMan &, const JSONRPCRequest &) const: Assertion `block_template' failed.
See attached debug logs of two examples.
getblocktemplate_during_startup.log getblocktemplate_during_shutdown.log
This was found with a test running on Antithesis.