The item command works too.
/minecraft:item replace entity @s weapon.mainhand with bundle[bundle_contents=[{id:netherite_sword,components:{max_stack_size:99}}]]
The item command works too.
/minecraft:item replace entity @s weapon.mainhand with bundle[bundle_contents=[{id:netherite_sword,components:{max_stack_size:99}}]]