Is magnetic flux through a closed surface still zero if you just have the North pole of a magnet inside the surface

Before I ask the question, I want to be clear that I am NOT talking about magnetic mono-poles.

Gauss Law of Magnetism says that magnetic flux inside a closed surface is always zero, the reason being (what I understood), if there is a North pole, there has to be a South pole, so the number of magnetic field lines that enter the surface is equal to the lines that leave it.

So that got me thinking, what if we keep just the North pole of a magnet inside the surface and South pole outside it. Then the magnetic field lines will just leave the surface and I don't think the flux will be zero.

Where am I going wrong?

The field lines do not start at the north pole of a bar magnet and end at the south pole. They form loops that run through the inside of the bar magnet like this:

(image from Hyperphysics)

So when we stick the north pole inside a sphere we get this:

The field lines enter the sphere by flowing inside the magnet and exit it by flowing outside the magnet. The net flux through the sphere ends up as zero.

The field lines enter the region through the magnet interior.