Apparently the NaNs were generated by the function fast_sine when the angle was 0°, 360° or any multiple.
The interpolation "if" was written so that when this angle were selected a negative position was read on the sine_table.
Once it was fixed the NaNs have not returned, yet. However, due to the debugging the python code is a little messy and does not save the files nor the plots correctly.