Hmm I don't see anything wrong with it to be honest. I'll post my code, see if you can look at it and figure it out. My code's very similar to Halfling's Halfling code, but modified to fit my own stuff. I define the castes after I get all of their universally shared stuff out of the way - perhaps you should define all of the castes at once, then use [SELECT_CASTE:castenamehere] to define their independent attributes? Not sure. But heres the code, if it helps you at all.
creature_vegipygmi
[OBJECT:CREATURE]
[CREATURE:VEGIPYGMY_NUT]
[DESCRIPTION:Short, thin, and green, this small humanoid wields a spear. Tendrils of fungus dangle from its arms, midsection, and legs. Its hair is made of mossy dreadlocks.]
[NAME:vegipygmy:vegipygmies:vegipygmy]
[CREATURE_TILE:1][COLOR:3:0:0]
[CREATURE_SOLDIER_TILE:2]
[PREFSTRING:mossy dreads]
[PREFSTRING:dangling tendrils]
[INTELLIGENT][MUNDANE][NOCTURNAL][CANOPENDOORS]
[CAVE_ADAPT][LIKES_FIGHTING][NO_SLEEP][NONAUSEA]
#better creature classification - easier syndrome targeting
[CREATURE_CLASS:ALL][CREATURE_CLASS:HUMANOID][CREATURE_CLASS:NO_POISON]
[CREATURE_CLASS:PLANT][CREATURE_CLASS:VERTEBRATE]
[LITTERSIZE:1:10]
[HAS_NERVES][EQUIPS][HOMEOTHERM:10070]
[GENERAL_CHILD_NAME:vegipygmy seedling:vegipygmy seedlings]
[SWIMS_LEARNED][SWIM_SPEED:3000]
[MANNERISM_LAUGH]
[MANNERISM_SMILE]
===================================
#any special interactions here so they're visible. I'm adding CLEANS_SELF_DAILY to any domestic creature to avoid lag due to contaminants.
[APPLY_CREATURE_VARIATION:CLEANS_SELF_DAILY_HLG]
#basic body structure: humanoid core (torso, abdomen, head), back legs, humanoid arms, external ears, teeth)
[BODY:CORE_HLG:BACK_LEGS_HLG:ARMS_HLG:EXTERNAL_EARS_HLG:TEETH_HLG]
#add relevant materials and tissues
[BODY_DETAIL_PLAN:VEGICORE_MATERIALS_NUT]
[BODY_DETAIL_PLAN:VEGICORE_TISSUES_NUT]
[BODY_DETAIL_PLAN:TEETH_HLG]
#then layers
[BODY_DETAIL_PLAN:CORE_LAYERS_HLG]
[BODY_DETAIL_PLAN:BACK_LEGS_LAYERS_HLG]
[BODY_DETAIL_PLAN:ARMS_LAYERS_HLG]
[BODY_DETAIL_PLAN:EXTERNAL_EARS_LAYERS_HLG]
#the following adds hair material, tissue (first token) and puts them where they should be
[BODY_DETAIL_PLAN:HAIR_HLG]
[BODY_DETAIL_PLAN:HAIR_ON_HEAD_HLG]
#for two legged creatures this should be added so there's no mention of "back feet"
[BODYGLOSS:TWOLEGS_HLG]
#tendons are included in CORE, now we just make them tendons and ligaments
[TENDONS:LOCAL_CREATURE_MAT:TENDON:400]
[LIGAMENTS:LOCAL_CREATURE_MAT:TENDON:400]
#blood is included in CORE, just define it
[BLOOD:LOCAL_CREATURE_MAT:BLOOD:LIQUID]
#attacks
[ATTACK:PUNCH:BODYPART:BY_TYPE:GRASP]
[ATTACK_SKILL:GRASP_STRIKE]
[ATTACK_VERB:punch:punches]
[ATTACK_CONTACT_PERC:100]
[ATTACK_FLAG_WITH]
[ATTACK_PRIORITY:MAIN]
[ATTACK:KICK:BODYPART:BY_TYPE:STANCE]
[ATTACK_SKILL:STANCE_STRIKE]
[ATTACK_VERB:kick:kicks]
[ATTACK_CONTACT_PERC:100]
[ATTACK_FLAG_WITH]
[ATTACK_PRIORITY:SECOND]
[ATTACK:BITE:CHILD_BODYPART_GROUP:BY_CATEGORY:HEAD:BY_CATEGORY:TOOTH]
[ATTACK_SKILL:BITE]
[ATTACK_VERB:bite:bites]
[ATTACK_CONTACT_PERC:100]
[ATTACK_PENETRATION_PERC:100]
[ATTACK_FLAG_EDGE]
[ATTACK_PRIORITY:SECOND]
#appearance variations
[APPLY_CREATURE_VARIATION:APPEARANCE_VARIABILITY_BODYSIZE_HLG]
[APPLY_CREATURE_VARIATION:APPEARANCE_VARIABILITY_HEAD_HAIR_HLG]
[APPLY_CREATURE_VARIATION:APPEARANCE_VARIABILITY_FOOT_HAIR_HLG]
[APPLY_CREATURE_VARIATION:APPEARANCE_VARIABILITY_EYE_COLOR_HLG]
[APPLY_CREATURE_VARIATION:APPEARANCE_VARIABILITY_SKIN_COLOR_HLG]
#Listing the 11 different castes
#The standard Vegipygmi, and the only female caste; includes info on age and body size for females.
[CASTE:FEMALE]
[CASTE_NAME:vegipygmy:vegipygmies:vegipygmy]
[FEMALE]
[BABY:1][CHILD:5]
[MAXAGE:30:40]
[BODY_SIZE:40000]
[BODY_SIZE:0:0:3000]
[BODY_SIZE:1:0:10000]
[BODY_SIZE:10:0:40000]
#Male caste 1 - breaths noxious gas, unleashes spores, explodes into goodies and spores upon death; obese; spores cause chronic disease
[CASTE:BROWNPYGMY]
[CASTE_NAME:brown vegipygmy:brown vegipygmies:vegipygmy]
[MALE]
#Male Caste 2 - fireproof, spits webs, immune to webs, has extra eyes, and has numerous extra tendrils; also immune to paralyzation
[CASTE:REDPYGMY]
[CASTE_NAME:red vegipygmy:red vegipygmies:vegipygmy]
[MALE][FIREIMMUNE_SUPER]
[THICKWEB][WEBIMMUNE][PARALYZEIMMUNE]
[USE_MATERIAL_TEMPLATE:SILK:VEGISILK_TEMPLATE_NUT]
[WEBBER:LOCAL_CREATURE_MAT:SILK]
[CAN_DO_INTERACTION:MATERIAL_EMISSION]
[CDI:ADV_NAME:Spray web]
[CDI:USAGE_HINT:ATTACK]
[CDI:BP_REQUIRED:BY_TOKEN:LB]
[CDI:MATERIAL:LOCAL_CREATURE_MAT:SILK:WEB_SPRAY]
[CDI:TARGET:C:LINE_OF_SIGHT]
[CDI:TARGET_RANGE:C:5]
[CDI:MAX_TARGET_NUMBER:C:1]
[CDI:WAIT_PERIOD:30]
#Male Caste 3 - amphibious, friendly to local wildlife, strong bite and a good grappler/tamer; can latch with bite
[CASTE:BLUEPYGMY]
[CASTE_NAME:blue vegipygmy:blue vegipygmies:vegipygmy]
[MALE][AMPHIBIOUS][AT_PEACE_WITH_WILDLIFE]
[ATTACK:BITE:CHILD_BODYPART_GROUP:BY_CATEGORY:HEAD:BY_CATEGORY:TOOTH]
[ATTACK_SKILL:BITE]
[ATTACK_VERB:bite:bites]
[ATTACK_CONTACT_PERC:100]
[ATTACK_PENETRATION_PERC:100]
[ATTACK_FLAG_EDGE]
[ATTACK_PRIORITY:MAIN]
[ATTACK_FLAG_CANLATCH]
#Male Caste 4 - immune to traps, can pick locks, can enrage, can see regardless of having eyes
[CASTE:GREENPYGMY]
[CASTE_NAME:green vegipygmy:green vegipygmies:vegipygmy]
[MALE][LOCKPICKER][TRAPAVOID][PRONE_TO_RAGE:10]
#Male Caste 5 - extremely tough, strong, but slow; can trance, feels no fear
[CASTE:GREYPYGMY]
[CASTE_NAME:grey vegipygmy:grey vegipygmies:vegipygmy]
[MALE][TRANCES]
#Certain attributes that all male Vegipygmies share, such as age and body size by age.
[SELECT_CASTE:BROWNPYGMY]
[SELECT_ADDITIONAL_CASTE:BLUEPYGMY]
[SELECT_ADDITIONAL_CASTE:REDPYGMY]
[SELECT_ADDITIONAL_CASTE:GREENPYGMY]
[SELECT_ADDITIONAL_CASTE:GREYPYGMY]
[BABY:1][CHILD:20]
[MAXAGE:400:600]
[BODY_SIZE:40000]
[BODY_SIZE:0:0:3000]
[BODY_SIZE:1:0:10000]
[BODY_SIZE:20:0:40000]