I make the case that there is insufficient difference between $F = ma$, and $W = mg$ to have deprived you of marks in that test.
Firstly, imagine a rocket with a flat front, firing away, but pinned against a sideways wall. Or imagine one of the recent electric drones, that has flown into a ceiling and is stuck there. In both cases there will be no motion. Acceleration is $a = F/m$, where F is due to thrust.
In classical mechanics, how is this fundamentally different from acceleration due to gravity? For all its differences from a rocket engine or a drone propeller, the earth is simply thrusting us towards its centre, is it not?
Secondly, there is the moon happily pulling upwards a part of the earth's ocean that it happens to be above, accelerating it by gravity but also causing motion. The moon generally varies the gravitational pull on earth. In terms of Newtonian mechanics, nothing sacred, just another force.
Thirdly, we have the kilogram-force: "The kilogram-force...is is equal to the magnitude of the force exerted by one kilogram of mass in a 9.80665 $m/s^{2}$ gravitational field" (Ref). Kilogram-force is no different from weight in magnitude. However, it can act in any direction. According to the ref, while newtons $N$ is standard, the kilogram-force is still used in China and by the European Space Agency.
$W = mg$ is merely a special case of $F = ma,\quad$.
There is no conceptual difference between the two.
I grant you permission to use my explanation to confront your teacher(s).