onMouseDrag only works once

I’m totally stumped on this one. I have the following extremely basic code. It works perfectly exactly once - the object is dragged along with the mouse cursor. After that, you can no longer interact with the object. There are no other scripts working on the object. Here’s the code:

public void OnMouseDrag()    {
    transform.position = Camera.main.ScreenToWorldPoint(new Vector2(Input.mousePosition.x, Input.mousePosition.y));

    Debug.Log("transform.position : " + transform.position);
}

I faced exactly the same issue.
It looks like you turned off auto simulation somewhere in code or in project physics settings. Please look for Physics2d.autoSimulation = false or check you project settings!