Your son could be having a lower respiratory tract
infection like pneumonia
. His rise in temperature and cough could be symptoms of pneumonia or bronchitis
. Any wheezing
, productive/bloody sputum, rapid/ fast breathing? Probably he had experienced wheezing for the first time along with this cough which made him feel he cannot breathe and caused him to panic. Sometimes, infections and high temperature can cause an altered behaviour in children.
Good thing that you are taking him to the paediatrician.
Hope your son gets well soon :)