No, i mean, yeah of course the "cc_set_sub_weapon dev_gm_spear" worked.
As far as i know though, you can't take 'dev_gm_spear' and equip it to your weapon slot with a command, which is what you were trying to do with "cc_set_weapon dev_gm_spear", "cc_set_primary_weapon dev_gm_spear", and "cc_set_main_weapon dev_gm_spear", right? D/w we don't need a screenshot to see that "cc_set_sub_weapon dev_gm_spear" works.