If a soldier drops an item during battle that is marked as autosell and doesn't pick it back up again before the mission ends, that item is treated as dropped by the enemy and sold. This has happened to me with a plasma pistol which I dropped in order to use a medikit. Soldier equipment that was brought into the mission should be excluded from being sold automatically upon the end of the mission.
(A post has been made on the bug tracker regarding this bug.)