If you want to avoid being lost in Newtonian mechanics, follow these steps:
Define clearly your system.
In your example, you have the choice between A, B, and (A+B)
Identify all the external forces applied to your system.
Check if the mass of the system is constant. You cannot directly apply
Newton's second law if it is not the case.
Check if your system is a rigid body. If it is not the case, you must calculate the position of its center of mass.
Apply Newton's laws:$$ \sum_i \overrightarrow{ F_{i} } =m. \overrightarrow{ a } _{cm}$$
$$ \sum_i \tau _{i} =I \frac{d \omega }{dt} $$
Identify the unknowns: $$ \overrightarrow{a} , \omega , \overrightarrow{ F }_{contact}$$
The contact forces like the normal force, the friction forces, etc... are never known before hand. One must eliminate them from the equations (by combination), solve for the acceleration and then calculate them once we know the acceleration.
To come back to your problem:
Before the collision:
During the collision:
A new contact force must be taken into account. B exerts the force $ F_{B/A}$ onto A and A exerts the force $ F_{A/B}$ onto B.
System: A
External applied force: $ F_{B/A}$, $F$
Newton's second law: $ F-F_{B/A}=m_{A}.a_{A}$
System: B
External applied force: $ F_{A/B}$
Newton's second law: $ F_{A/B}=m_{B}.a_{B}$
Newton's third law allows us to simplify a little bit the problem by eliminating one of the contact forces.
$$ F_{A/B}=-F_{B/A}=f$$
But we still have two equations with three unknowns: $ a_{A}, a_{B}, f $.
$$\begin{cases}F-f=m_{A}.a_{A}\\f=m_{B}.a_{B}\end{cases} $$
Let's see if we can find a new equation by considering the system A+B.
System: A+B
External forces: F.$ ( F_{A/B}$ and $F_{B/A}$ )are internal forces.
Rigid body: no. The position of the center of mass of the system is changing. It is given by:$$\begin{cases} x_{cm}= \frac{m_{A}x_{A}+m_{A}x_{B}}{m_{A}+m_{B}} \\v_{cm}= \frac{m_{A}V_{A}+m_{A}V_{B}}{m_{A}+m_{B}}\\a_{cm}= \frac{m_{A}a_{A}+m_{A}a_{B}}{m_{A}+m_{B}}\end{cases} $$
Newton's second law: $ F= \big(m_{A}+m_{B}\big) a_{cm}$
You may think, you have enough equations to solve the problem. Unfortunately, it is not the case, the equation: $ F= \big(m_{A}+m_{B}\big) a_{cm}$ is not independent of: $$\begin{cases}F-f=m_{A}.a_{A}\\f=m_{B}.a_{B}\end{cases} $$
Indeed by adding member wise, we get:
$$ 0=F-f+f=m_{A}.a_{A}+m_{B}.a_{B}=\big(m_{A}+m_{B}\big) a_{cm}$$
At this point, you can already answer your question.
During the collision, the force applied to B is different from the force applied to A.
$$F_{/A}=F-f$$ and $$F_{/B}=f$$
Even if the external force F is null during the collision, you cannot use the acceleration prior to the collision to calculate the force on B.
$F_{/B}=f=-m_{A}.a_{A}$ where $a_{A}$ is the acceleration during the collision (not $ a= 3 m/s^{2}$).
At last, the acceleration of B after the collision is null. As soon as the contact between A and B breaks off, the force f disappears.
But can we solve the problem and calculate the motion of A and B after the collision. We still have two equations and three unknowns, so we can't. To go any further, one needs more information about the collision process. In introductory mechanics courses, one generally assumes the collision to be elastic (e=1) or inelastic with a coefficient (e<1). That is enough to calculate the velocities of A and B after the collision. But to calculate the force of interaction one further needs the duration$ \triangle t$ of the collision. The force acting onto B during the collision is then given by:
$$ f \approx m_{B}\frac{ \triangle V_{B}}{ \triangle t} $$