50 KHz data rate - that is impressive. Sometimes portions of the code are running much faster than others and you have to add "wait for data to be ready" code.
I have not written code in a long time, but I am working with an embedded code writer on a project and he runs into weird stuff like that all of the time.
I assume that you are using real time coding to pull that off?
edit
The company that I work for has struggled to use an FPGA sampling for analog sampling even at 10 ms sample rates and feed it into a controller error free. There was a lot of noise in their incoming analog signal, more than they expected.
EDITED: 13 Apr 2016 19:54 by HARRYN