Documentation mismatch for -A / -U
Yes, that was wrong. I fixed it almost nine years ago, before version 14.4.0: https://sourceforge.net/p/sox/code/ci/f5af200cef7352195994ee670c35a0f348d73732/ Those options have since been removed altogether. I have no idea how die.net can be nudged to update their version of the man page.
trim nr samples different behavior from nr seconds
Well, when a time is converted to a sample count by SoX, the current rate is automatically taken into consideration. When you specify a number of samples directly, you need to do that yourself. So, in your example from the first post, youstart with a sampling rate of 48000 Hz, which is the nullfile default. Then you trim to 4000 samples, which is 1/12 of a second, before the audio is automatically converted to the specified output rate of 16000 Hz, where 1/12 of a second is approximately 1333 samples....
Converting the same wav file twice throws different output
That’s working as expected; the dither noise is (pseudo-)random, so will be different each time. If you need bit-identical output, use -R (or turn dithering of with -D, but audio quality will be slightly worse then).
Even though the resampling effect by default is inserted at the end (if there is...
Trim to output sample rate