My guess is that your code that defines the block def fails to make the attdef, tho it does succeed at making the block def.
While your call to make the insert, c/w attribute succeeds, there is no corresponding attdef entry in the block definition, so it cannot find the associated prompt.