When an object is projected vertically up, its velocity at the highest point will be zero. But the net force is not zero, and is $mg$ vertically down where $m$ is the mass of the object and $g$ is the acceleration due to gravity.
When an object executes Simple Harmonic Motion (SHM), it's velocity is zero at its extreme positions. But the force is not zero. In fact it has the highest magnitude when the object is at either of the two extreme positions. This is because, the restoring force on an object executing SHM is given by $F=-kx$ where $k$ is the force constant and $x$ is the displacement from the mean position.
In the above two examples, even though the object is at momentary rest, the net force on it is not zero. We know from Newton's first law, that if the velocity of an object is constant, the net force on it is zero. But here it is not zero.
Why is there a contradiction (First law says no net force even though the net force is non-zero) here? Or did I do any mistake here?