You make a good point which requires us to be more careful about what Fermat's Principle says and how the proof proceeds. The upshot of what I'm going to say is
The statement of the Law of Reflection must include an appropriate constraint.
Here's what I mean in detail. First, let's give a precise statement of Fermat's Principle:
Fermat's Principle. Let $\mathscr C_3$ denote the set of all continuous curve segments in three dimensions. Let points $A$ and $B$ in three dimensions be given. Suppose that a light ray begins at point $A$ and ends at point $B$, and suppose that the path of the light ray is constrained to not lie in some subset $\chi\subseteq \mathscr C_3$, then the path that light takes between $A$ and $B$ is a critical point of the travel time functional for any variation of paths contained in the set $\mathscr C_3\setminus\chi$.
We can use this principle to prove either of the following two statements, all three of which one might be inclined to call the Law of Reflection.
Law of Reflection 1. If light is emitted in a given direction towards a mirror, then (i) the light will travel in a straight line towards the mirror along the initial direction, (ii) it will hit the mirror, (iii) it will reflect in a straight line, and (iv) the angle of incidence will equal the angle of reflection.
Law of Reflection 2. If light is emitted from a point above a mirror, and if the light makes contact with the mirror, then (i) the light will travel in a straight line from its initial point to the point of contact, (ii) it will reflect in a straight line, and (iii) the angle of incidence will equal the angle of reflection.
Notice that in both of these cases, there is a constraint that one needs to take into consideration when determining the path of least time. In the first statement above, the constraint set $\chi$ is the set of all continuous paths whose initial directions do not coincide with that of the specified initial direction. In the second statement of the Law, the constraint set $\chi$ is the set of all continuous paths that do not make contact with the mirror.
Note that if you don't include a constraint, and if you simply pick any two points above the mirror, then, of course Fermat's Principle tells you that the path followed by light is the straight line segment joining those two points. But that's fine, because the Law of Reflection doesn't answer the question "given any two points $A$ and $B$ above a mirror, and given that a light ray goes from $A$ to $B$, what is the path that the light ray must take?" In fact, this question doesn't have a unique answer. The answer depends on the constraints.