What are the products of the thermal decomposition of potassium cyanate with carbon at elevated temperature?
[...] some of the nitrogen is lost and forms something [...]


Carbon is a good and cheap reductant, often used in the processing of oxidic ores - except when metal carbides are formed. Carbon dioxide a reasonable product in these reactions.

$\ce{2KOCN + C -&gt;[\Delta] 2 KCN + CO2}$

Let's agree that potassium cyanate is reduced to potassium cyanide, while carbon dioxide is released.