mirror modifier kinda glitch
Rotating an object can make the mirror axis un-intuitive. You can see current rotation in the transform panel, which is opened with N in the 3D viewport . You should apply rotation with Ctrl + A and then it will behave like you expect.