I didn't give away the last bit of how to get the premine done. I gave the information to get about 90% of the way there. I told you how to figure out what the key you needed to import that transaction would be. But I guess what the hell. We'll go to 99%.
There's a database of uncommitted transactions. Processing a block, the software takes transactions from this database to add txOuts to your wallet - whenever it finds one of the uncommitted transactions in the block.
Normally this is fine. When it's forming a block itself, it adds the coinbase tx to the database before it processes the block. When it's checking existing blocks, it adds the transactions it sees in the block to the database when it receives the block.
Your problem is that the genesis block is causa sui. The software isn't forming the genesis block itself, and it didn't receive it. So the initial coinbase transaction doesn't get into the database of pending transactions in either of the two "usual" ways.
Your software sees a valid block, where every transaction checks as a valid transaction, etc. It decides to accept the block. So when it accepts the block as part of the block chain, it takes everything in its database that matches any of those transactions (ie, nothing in the case of the Genesis block) and checks all of that stuff to see if there's a txOut in it that can be added to your wallet. If it finds the txOut, it adds it to your wallet. It didn't add the genesis coinbase. No problem, I told you how to import it yourself after the fact.
So you imported the key, and it imports just fine, because it looks back through the blocks, and sure enough, there exists such a coinbase transaction. But then you try to actually spend it, and when it's checking the transaction it repeats the whole "did this txOut successfully get imported from the database?" check, and observes that no, that's an empty damn database when the genesis block is processed and no such amount exists.
This was supposed to be sort of an "exam question" - somebody who is capable of making and maintaining an altcoin is expected to be able to figure it out.
That would involve going to see where txOuts get added to the wallet, tracing back to see why the genesis coinbase wasn't making it, figuring out that the txOuts get added to the wallet when they are looked up in the database, discovering that the coinbase txOut isn't in the database when the block gets processed, looking to see when and how transactions get into the database, realizing that neither of those things were happening in the case of your genesis block, and then correcting the problem. A moderately involved case of debugging a code problem.
The modifications I tried does not work.
Giving away the 1 % of the answer that remains would be great !