Ah, so this is the problem: the 'panel' variable in InsertListItem (as in all functions that treat user interface objects) must receive the handle of the panel that the control lies on. This is basically how the user interface is structured: LoadPanel returns a handle to that particular instance of the panel and all subseguent function address an individual control on that instance pointed to by the handle. This permits you to have different instances of a panel and treat them independently from each other.
 
Since the constant name is in effect a macro with an associated integer value, you have no syntax errors in your code, but the function is more likely to return an error since you are pointing to an object that either is different from the one you expect or doesn't exist at all!
 
So if you pass the handle of the panel instead of its constant name, you will solve your problems.