update: analytic $x(t)$
Note that the differential equation for $x(t)$ can be solved analytically, which improves the stability and accuracy of the result:
DSolve[{x'[t] == -a*x[t] + Sin[t], x[0] == 1}, x[t], t] // FullSimplify
(* {{x[t] -> ((2 + a^2) E^(-a t) - Cos[t] + a Sin[t])/(1 + a^2)}} *)
Therefore we can define the problem more accurately as
x[a_, t_] = ((2 + a^2) E^(-a t) - Cos[t] + a Sin[t])/(1 + a^2);
sol = ParametricNDSolveValue[{
y'[t] == a*x[a, t] - b*y[t]^2,
z'[t] == b*y[t] - Cos[t],
w'[t] - w[t] == x[a, t] + y[t]^2 + z[t]^3,
y[0] == 0, z[0] == 0, w[0] == 0},
{y, z, w}, {t, 0, tmax}, {a, b}, MaxSteps -> Infinity];
model[t_?NumericQ, a_?NumericQ, b_?NumericQ] := sol[a, b][[3]][t]