Plastics tend to consists of carbon and hydrogen chains. See for example polycarbonate [1], polyetene [2] and ABS [3] (contains nitrogen). They might however contain all sorts of additives. In order to produce just water, carbon dioxide and nitrogen the burning must be carefully controlled [4] - in your experiment the burning was probably not complete, which explains the fumes (that might have been carcinogenic [4]).
[1] https://en.wikipedia.org/wiki/Polycarbonate
[2] https://en.wikipedia.org/wiki/Polyethylene
[3] https://en.wikipedia.org/wiki/Acrylonitrile_butadiene_styren...
https://en.wikipedia.org/wiki/Plastic#Incineration_of_plasti...