many professions specify nested contents in the form of
{ "item": "medium_plus_battery_cell", "ammo-item": "battery", "charges": 600, "container-item": "mil_mess_kit" },
and
{
"item": "m2010",
"ammo-item": "300_winmag",
"charges": 5,
"contents-item": [ "shoulder_strap", "rifle_scope", "bipod" ]
},
which apparently fails to insert into those items due to pocket type mismatches?
put_in failed messagesstuff specified in professions should get their contents.
presumably item group json should either be more permissive when inserting things, or updated to use the correct pocket type, or something?


since this seems to be an item groups issue, it very likely affects actual loot items out in the wild instead of just being limited professions, i'm just not in a position to verify that
other things also fail to go into containers, but not for the above reasons; for instance, M24 fails to insert in back holster on the police sniper weapon, but that's because the M24 is too long for the back holster to hold. so not all profession put_in errors are this problem.
I currently have issues spawning ammo or mags in spawned guns of downed zeds (or even ground-spawned guns) so I think you're right. Latest tests seem to spawn ammo drops within guns that take ammo directly (shotguns), but guns that take ammo in mags (like M4) spawn empty. :(
Zeds that drop holsters with handguns also ALWAYS spawn without ammo in the gun or even a magazine.
Note, the patch mentioned in the issue description is no longer necessary since #41677 added an explicit debugmsg to report put_in failures here.
I have checked the full list of professions in current master 963edfda and none of them are reporting failures when scrolling through the starting profession list. I checked a few professions by spawning new characters into a world, and verifying items were loaded up correctly:
There is still a discrepancy, that can_contain in fact returns different results than insert_item for gunmods. For example item( "m4a1" ).contents.can_contain( item( "shoulder_strap" ) ) will fail, while insert_item with the same gun/gunmod succeeds. I will submit a PR with test cases for this, but it does not appear to have an adverse effect on starting profession spawns.
TL;DR This issue should be resolved now, but having additional confirmations would be great.
Police sniper starting inventory screenshot:

@esotericist You have mentioned this being one of your preferred professions. It looks like everything is here now, please confirm.

Confirmed with Military Recruit on 11003.
_Note_, the patch mentioned in the issue description is no longer necessary since #41677 added an explicit
debugmsgto reportput_infailures here.
Note to the note: I kind of want to revert (or rework) that in #44155 because it fires even when not appropriate. This is not the place to discuss it, I just wanted to mention it here in case things change because of that.
This issue was fixed in #41677 which the person above wants to revert (LOL).
Bionic Sniper with 300_winmag ammo and "shoulder_strap", "rifle_scope", "bipod" mods:

You can close this issue.