Heaters aren't the only thing that can contain Teflon/PTFE/PFCs/PTFOA (which can kill) BUT-- I am
not saying it is that-I have no clue--- it could be bacterial, viral , something that he/she ingested, or something else congenital..Birds catch things just like we do (even if never exposed to other birds).
I will post a list of things that can contain PTFE/PFOA/PFCS etc (just so you have it---but I am not saying that is what this is)...You need to get your bird checked out by a vet that knows parrots well (preferably a board certified avian vet if available where you are)-- like I said, as prey animals, they hide illness as long as they can, so if you see anything odd, you need to get it checked--especially cage-bottom-sleeping.
See the link below-
http://www.parrotforums.com/questions-answers/83478-my-new-king-parrot-scares-me.html <- scroll down to my 2 massive posts towards the bottom of that first page--- the first talks about fumes etc and the 2nd talks about "sleeping on the bottom of the cage" The time stamps are 6:51 AM and 7:04 for the 2 long posts and is found at the very top left corner in small print (above the body text etc and username). The shorter posts (further toward the top of the first page) also discuss metal toxicity.
Again- yours could have anything going on---I am not saying that these things are definitely the cause, but there is a whole list of stuff that can cause problems in that link, and if you aren't doing any of those things wrong, then again, viral, bacterial, congenital etc...I am only posting this so that you can rule things out--not to upset you. Babies have SO much that can go wrong, so right now, the best thing is just to make sure your bird goes to a good vet.
I keep a pretty clean cage, but my bird randomly got infections when she first came to me (maybe out of stress) but it does happen. Whatever the issue here, it's bad enough to be causing major red-flags.
PS- Just saw what you said about fireworks-- they can scare birds/harm, and they also produce smoke/chemicals which can be dangerous to them..
HOWEVER, If he was going to die from fright, I think he would be dead already (heart attack)...Although...is it possible that he flew into his cage when frightened by the sound (were you with him when there were going off?
I have a feeling that this is something else besides the firework fumes (unless they were strong in your house or the windows were down). I also think it is something more than just general fear ((unless he concussed himself with a night fright).
Again-- only a vet can say for sure (hopefully a good one...as not all vets are good with birds even if they see them regularly).