Try restarting the wallet via cmd. While restarting type --rescan in cmd so that the wallet would re-compute almost all the transactions and would display the new updated balances. I need few details so that I can figure out where have you gone wrong
[1] Are the coins showing up in another wallet? Since you have said you sent coins from another wallet, does that mean have you mined some coins to another wallet and are those coins showing up in that another wallet?
Litecoin official core wallet automatically rescans the portion of the blockchain and shows updated balances from time to time.
What parts of the code could produce and or affect this result?
I am not really good in the code, but let me try to explain how flow works...
Suppose you are the one who creates the Block and adds transaction to them using CreateNewBlock class. Once you have solved the block, the coinbase transaction looks for the scriptPubKey parameter of the class and sends you the generated coins.
For you to get paid by coinbase transaction, the code is present in miner.cpp file I guess. I am not really sure about it
// Create coinbase transaction.
CMutableTransaction coinbaseTx;
coinbaseTx.vin.resize(1);
coinbaseTx.vin[0].prevout.SetNull();
coinbaseTx.vout.resize(1);
coinbaseTx.vout[0].scriptPubKey = scriptPubKeyIn;
coinbaseTx.vout[0].nValue = nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus());
coinbaseTx.vin[0].scriptSig = CScript() << nHeight << OP_0;
pblock->vtx[0] = MakeTransactionRef(std::move(coinbaseTx));
pblocktemplate->vchCoinbaseCommitment = GenerateCoinbaseCommitment(*pblock, pindexPrev, chainparams.GetConsensus());
pblocktemplate->vTxFees[0] = -nFees;
LogPrintf("CreateNewBlock(): block weight: %u txs: %u fees: %ld sigops %d\n", GetBlockWeight(*pblock), nBlockTx, nFees, nBlockSigOpsCost);