1L) The (generalized) position $q$ and (generalized) velocity $v$ are independent variables of the Lagrangian $L(q,v,t)$, cf. e.g. this Phys.SE post.
1H) The position $q$ and momentum $p$ are independent variables of the Hamiltonian $H(q,p,t)$.
2L) The position path $q:[t_i,t_f] \to \mathbb{R}$ and velocity path $\dot{q}:[t_i,t_f] \to \mathbb{R}$ are not independent in the Lagrangian action $$S_L[q]~=~ \int_{t_i}^{t_f}\!dt \ L(q ,\dot{q},t).$$
See also this Phys.SE post.
2H) The position path $q:[t_i,t_f] \to \mathbb{R}$ and momentum path $p:[t_i,t_f] \to \mathbb{R}$ are independent in the Hamiltonian action
$$S_H[q,p]~=~\int_{t_i}^{t_f}\! dt~(p \dot{q}-H(q,p,t)).$$
3L) Under extremization of the Lagrangian action $S_L[q]$ wrt. the path $q$, the corresponding equation for the extremal path is Lagrange's equation of motion
$$\frac{d}{dt}\frac{\partial L(q,\dot{q},t)}{\partial \dot{q}}
~=~ \frac{\partial L(q,\dot{q},t)}{\partial q},$$
which is a second-order ODE.
3H) Under extremization of the Hamiltonian action $S_H[q,p]$ wrt. the paths $q$ and $p$, the corresponding equations for the extremal paths are Hamilton's equations of motion
$$-\dot{p}~=~\frac{\partial H}{\partial q} \qquad \text{and}\qquad
\dot{q}~=~\frac{\partial H}{\partial p} ,$$
which are first-order ODEs.
4L) The equation $p=\frac{\partial L}{\partial v}$ is a definition in the Lagrangian formalism. E.g., for a non-relativistic free point particle, it encodes the relation $p=mv$.
4H) The equation $\dot{q}=\frac{\partial H}{\partial p}$ is an equation of motion in the Hamiltonian formalism. E.g., for a non-relativistic free point particle, it encodes the relation $p=m\dot{q}$.
It will not be simpler to assume that $x(t=0)=0$, so let us consider general initial conditions
$$\tag{1} x(t=0)=x_0\quad\text{together with}\quad\dot{x}(t=0)=v_0.$$
Now the constant $A$ has dimension of jerk and the constant $m$ has dimension of mass.
We can effectively put the constants $A=1=m$ to unity by scaling the variables appropriately
$$x ~\longrightarrow~Ax, \qquad x_0 ~\longrightarrow~Ax_0, \qquad v_0 ~\longrightarrow~Av_0, \qquad t ~\longrightarrow~t,$$
$$\tag{2}p ~\longrightarrow~mAp, \qquad H~\longrightarrow~mA^2 H, \qquad S~\longrightarrow~mA^2 S. \qquad $$
[In other words, if we treat time $t$ as dimensionless, then we are effectively going to dimensionless variables. We can always in the end of the calculation restore the $A$- and the $m$-dependence by performing the opposite scaling of eq. (2).]
Now recall that the Hamilton's principal function $S(x,P,t)$ is a type 2 generating function for a canonical transformation $(x,p) \to (X,P)$, so that
$$\tag{3} p~=~\frac{\partial S}{\partial x} ,\qquad X~=~\frac{\partial S}{\partial P},\qquad K-H~=~\frac{\partial S}{\partial t}. $$
Next recall that the Kamiltonian $K\equiv 0$ vanishes identically, which implies that the new canonical variables $(X,P)$ are constants of motion (COM). Now where are we going to find two COM? Well, the two initial conditions (1) are two COM. Here it helps that OP has already found the full explicit solution by another method
$$\tag{4} x~=~x_0 +v_0 t +\frac{t^3}{6}\quad\text{and}\quad p~=~v_0 +\frac{t^2}{2}.$$
Let us therefore identify the new canonical variables with the initial conditions
$$ \tag{5} X~\equiv~x_0 \quad\text{and}\quad P~\equiv~v_0 . $$
Hence we get
$$\tag{6} \frac{\partial S}{\partial x}~\stackrel{(3)}{=}~p
~\stackrel{(4)}{=}~v_0 +\frac{t^2}{2}
\quad\text{and}\quad
\frac{\partial S}{\partial v_0}~\stackrel{(3)+(5)}{=}~x_0
~\stackrel{(4)}{=}~x - v_0 t -\frac{t^3}{6}. $$
Eq. (6) has the full solution
$$\tag{7} S(x,v_0,t)~=~(v_0 +\frac{t^2}{2})x- \frac{v_0^2 t}{2} -\frac{v_0t^3}{6} +S_0(t)$$
for some function $S_0(t)$, which can only depend on the time variable $t$. Inserting eq. (7) into the Hamilton-Jacobi equation yields
$$\frac{v_0^2 }{2}+\frac{v_0t^2}{2} -tx -\frac{\partial S_0}{\partial t}
~\stackrel{(7)}{=}~-\frac{\partial S}{\partial t}$$
$$\tag{8} ~\stackrel{\text{HJ eq.}}{=}~H~=~\frac{p^2}{2} -tx~\stackrel{(4)}{=}~\frac{1}{2}\left(v_0 +\frac{t^2}{2}\right)^2-tx,$$
which leads to
$$\tag{9} S_0(t) = -\frac{t^5}{40} $$
plus an irrelevant integration constant.
Best Answer
OP is right. The text has an error. A cyclic coordinate $q_j$ does not have to be an linear function of $t$.
Example: Consider two canonical pairs $(q,p)$ and $(Q,P)$ with Hamiltonian $H= p Q +P$.
Then $q$ is cyclic, and therefore $p$ is a constant of motion.
$\dot{Q} =\frac{\partial H}{\partial P}=1$, so $Q$ is a linear function of time.
$\dot{q}= \frac{\partial H}{\partial p} = Q$, and hence $q$ is a quadratic function of time.