I know that Quests/Missions in ToP coding in general is buggy AF.
Better to rewrite your quest on another template, such as finding the quest closest to yours that requires you to slay enemies, and then change the monster ID and name, etc.
You can then try to make your own, but the thing is that if the trigger or addflag is wrong, it may mess up the whole quest. That's why it's buggy
Even I don't know that much about how to do quests cuz i was frustrated and stopped making them after failing a lot
It is possible, however, if you learn the flag. I think the maximum flag is 254 or something also.
I don't know much so I can't fully help.
SHAKO