Yes, it happens to me quite often.
Sometimes(occasionally!, but by far not reliably), I am able to halt the movement by doing the following:
Let's say my D-key (moving to the right side) gets stuck, and I continue to move to the right side. Then, I press and hold the opposite movement key (here, the A-key) to keep me somewhat stationary, and continously spam the stuck D-key (rapid press/release sequences). That may trick the sim into finally picking up the required "keyup" event from that D-key to make it un-stuck and halt the undesired movement.
If this works or not, might also be highly dependent on your keyboard model.