There are two errors that may be reported to OLE clients when calling exposed MAXScript functions that are specific to 3ds Max:
#512 -- an exception or interrupt occurred while running the called function
#513 -- the called function attempted to return an unsupported data type