Forwarded to the QA team for further investigation. We will reach out again if we need more information. Thanks for reporting and sorry for any inconvenience!
update: I found someone post a thread about how to slove this problem.
the person who post thread say he compared the data of pillum and triangular throwing spear's crafting pieces in Mount & Blade II Bannerlord\Modules\Native\ModuleData,crafting_pieces.xml, the pillum's head(spear_blade_3) has a flag called "NotStackable" . And after delete this flag the legionary will use pillum as javelin correctly.
<CraftingPiece id="spear_blade_38"
name="{=nr3K4od2}Pilum Head"
tier="4"
piece_type="Blade"
mesh="spear_blade_38"
length="23.7"
weight="0.0744"
excluded_item_usage_features="swing">
<PieceUsages unavailable_usages="TwoHandedPolearm_Couchable" />
<BladeData stack_amount="2"
physics_material="wood_weapon"
body_name="bo_spear_b"
holster_mesh="throwing_spear_quiver_3_2"
holster_body_name="bo_throwing_spear_quiver_3_2"
holster_mesh_length="96.8">
<Thrust damage_type="Pierce"
damage_factor="2.5" />
</BladeData>
<Flags>
<Flag name="BonusAgainstShield" />
<Flag name="NotStackable"
type="ItemFlags" />-------------------------------delete this then the legionary will throw their pillum
</Flags>
<Materials>
<Material id="Iron3"
count="1" />
</Materials>
</CraftingPiece>