For the first question, let me set the model's solver as fixed-step with sample time of 0.01. Your MATLAB Function runs every sample time and sums up by sin(377 * t). See the result below.
Now, see how the behavior changes if I change the sample time to 0.005.
As I mentioned, your MATLAB Function runs every sample time and sums up by sin(377 * t).
I do not know what exactly happens in the second model without looking into the model, but, in the first model what you might want to do is to use Clock block. Just use the Clock's output as time. In the last case below, I set the model's sample time 1/5000.