Check your camera projection. It will be perspective. It is because, in perspective view, depth is in the calculation. Since your mouse is in screen space, in simple words your mouse is on the camera itself. So you are trying to convert the camera coordinate into the world. That is why that code will debug the position of the camera itself.
So all you need to do is to add a distance from the camera to convert the point.
Vector3 screenToWorld;
void Update()
{
screenToWorld = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 5f));
Debug.Log(screenToWorld);
}
5f is the distance from the camera plane the coordinates will be converted.
Now, this issue will not happen when you switch to orthographic projection in the camera setting as there is no depth calculation required.
A small trick to understand this is to look at the camera gizmo in both the projection.
Perspective has a pyramid-like structure where orthographic has a cuboid-like. So the camera origin in the case of perspective is like a point and your mouse is operating on that point so it will only give you the camera coordinate. Isn't it? Now it's just a trick to remember that's all.

