That is expected behavior. When the index variable is step adjusted to fall outside the DO range the loop is terminated. In this case the step adjustment (BY value) is implicitly +1 because there is no explicit BY.
The GRANDTOT computation is done before the DO statement steps in the index variable TOTALB past the TO value (3), So you get GRANDTOT 104 and TOTALB 4.
The DS2 "DO Statement" reference documentation for TO stop covers the concept in detail:
Execution continues based on the value of increment until one of the following conditions is met: the value of index-variable passes the value of stop, ...
FWIW, horrible coding in this practice question, would not pass code review.