Mining empty blocks is not a good idea. It can happen when nSubsidy = 0 in the following code located in verification.cpp
With Bitcoin 0.18, this would create an orphan, an empty block. It is a consensus rejection. So doing this would block the wallet at starting when synchronizing at the specific transaction and a fork (bug fix) would be necessary to allows Bitcoin to accept the transaction.
You can try on testnet by changing the following code and return 0; see what happens

CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
// Force block reward to zero when right shift is undefined.
if (halvings >= 64)
return 0;
CAmount nSubsidy = 50 * COIN;
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
nSubsidy >>= halvings;
return nSubsidy;
}