Step 1, automation is rail working off screen as normal. It's not actually moving the actual position of the materials when not looked at for performance gains. It only tracks where on the rail it would be.
Step 2, Person looks at the rail causing everything to jump to where it should be.
Step 2a, first the game moves all the materials to where they should be in the world. Anything trapped in a wall isn't moved from the starting tile in the rail.
Step 2b, now the game builds the box for each item on the rail, and puts the item in the box.
Step 3, now you have one or more empty crates on your rail, and at the beginning of the rail you have resources that should be in those empty crates but aren't, and they appear to be floating on the rail without a crate.
This is the method to reproduce the bug. If you want to have an easy time to reproduce it have a rail that goes into and out of a checkerboard tile that is made to move slowly by an automation gate. Look away and let the automation run for a time, and then look at it and pause. You will see a bunch of empty crates in the walls, and if you let it run, it appears you have a floating resource near the beginning of the rail.
To be clear, the resource is actually where it appears to be! All thermal transfer to and from the resource is exactly as you'd expect it at it's location, and it will stay like that until it falls off the end of the rail. Nothing comes out when the empty crates exit, and no thermal transfer happens with those crates.
I don't know if the game is failing to move the item due to an exception, or if there's some assert saying an item can't be in a wall, but there is something preventing the items from actually being in a wall on a shipping rail when transitioning from off screen to on screen. My guess is it is an interaction with an optimization.
See this thread for more information discussing this bug:
See this thread for an example automation line that generates this bug:
I cannot find the output.txt file at \Steam\SteamApps\common\OxygenNotIncluded\OxygenNotIncluded_Data\ as requested. It does not appear to be here.
Edit: I added some pictures showing the empty shipping crates on the conveyor from the game not putting the ore in the right place as well as showing that the ore is showing over the conveyor loader instead. Also added my save game so you can test it.