Hereyou see the inserter stuck with an item in it's hand. (An inserter ironically)
Hereyou see the inventory of the cargo, there are still item spots to be filled but as you can see the inserter is still stuck with that one item which stack is allready full.
Steps to reproduce:
1: Get a train wagon
2: Filter it's inventory to hold a couple of different items but make sure the entire inventory is filtered.
3: (With a 3 stack inverter) Fill an item stack to for example 45.
4: Let the inserter fill the inventory from a chest.
5: Watch it get stuck at that one stack with an item still in it's hand.
Hopefully this explains the bug good enough, the desired result would be that the inserter only grabs that many items for which there are spots in the wagon so that it won't get stuck.