The topbar imposes an inset of 36 pixels, so you will want to account for that. It might also be a better idea to use UserInputService instead since the Mouse object is legacy.
local UserInputService = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService")
UserInputService.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
end
end)
Then in the if block you will want to subtract the inset from the mouse location.
local mouse_location = UserInputService:GetMouseLocation() - GuiService:GetGuiInset()