Im digging up this old thread as this is related to TrayIcon again with same code.

When Im building a Debug version of my application im getting a NIIF_ERROR icon in the Balloon tip though I have set value NIIF_NONE to dwInfoFlags.

ie:
nid.dwInfoFlags = NIIF_NONE;

but if I build a release version its fine.