I understood that your question is about the cause of the difference output between the two logics in attached model.
I think that the difference of these output are caused by the solver. (I think it is because there might be a difference in the calculation of the Jacobian matrix when calculating the value of the next step in Simulink. In this case, there may be a difference in the result with the variable step setting.)
However, the essential result of calculation is the same even if it is made with stateflow. Try changing the maximum step size to small (ex. 0.01s). The two outputs are almost the same as shown below. Therefore, by making the step size sufficiently small, it is possible to implement the expected processing even when using stateflow.
I hope this will help.