I'm sorry for your lost, it sucks when they die suddenly. A few possibilities come to mind, but unless you have a necropsy done you likely wont know, and even then it's not uncommon to be inconclusive especially if it's not done right away.
One is upper respiratory infection, I know that can kill chins within a couple hours of showing symptoms if not treated. Was he sneezing, coughing, or wheezing at all?
Another is bloat, basically a gas build up in the gut preventing anything from going through and shutting the gut down. Normally signs of that are things like small to no poops, not wanting to eat or move, belly feels hard instead of squishy, stretching and pushing their belly to the floor. Normally caused by eating something that doesn't agree with them, can even be something normally considered "safe", but sometime happens for seemingly no apparent reason (only being feed a good quality pellet food and hay).
He could also have eaten something he shouldn't have, for example if there was any plastic in the cage he could have chewed a piece and it damaged him internally. Or even a more "freak accident" situation of swallowing say a sharp piece of wood that caused internal damage. Internal bleeding would cause him to be grumpy from pain and also sleepy from blood loss.
How was the temp in the room? A young chin is much more sensitive to heat then an adult, so overheating can happen if it got too warm (about 70F) or if he was allowed to play for too long. Kits under 6 months also can't regulate their blood sugar as well and can over do it and have a dangerous drop in blood sugar, so large cages, out of cage time, and wheels are all not advised.
At only 5 months another possibility could be a genetic defect or heart murmur, those I don't think there is any sign other then if you had him checked at the vet and they noticed it during an exam.
Unfortunately something you just never know, one of mine passed last year, he seems fine the day before, I refilled the pellet bowls and he came and ate before I went to bed, but for some reason he passed in his sleep sometime during the night. He was 14+ years old, but still was not expected and he didn't really show any signs that would have tipped me off that something was wrong.