Inconsistency in formula for shortest distance between two points on a sphere.

I've found many formulas for the shortest distance between two points on a sphere, but all of them using coordinate geometry. I wanted a formula in terms of radius and angle subtended at the centre, since I feel those terms are much more intuitive. Heres my attempt to do so:

Consider points A and B on a sphere of radius $$R$$, subtending angle $$\theta$$ at the centre. A plane passing through these two points cuts the sphere in a circle of radius $$r$$. A and B subtend angle $$\beta$$ at the centre of this circle. Let $$l$$ be the length of the arc AB of the circle

Now, $$\ d(A,B) = 2R \sin \frac \theta2 = 2r \sin \frac \beta2$$

$$\therefore l = r \beta = R\beta \frac {\sin \frac \theta2}{\sin \frac \beta2}$$

For minima, $$\frac {dl}{d\beta} = 0$$

$$\therefore \frac {d}{d\beta} (\frac {\beta}{\sin \frac \beta2})= 0$$

$$\therefore \sin \frac \beta2 - (\frac \beta2) \cos \frac \beta2 = 0$$

$$\therefore \tan \frac \beta2 = \frac \beta2$$

$$\therefore \sin \frac \beta2 = \frac {\beta}{\sqrt {\beta ^2 + 4}}$$

$$\therefore l= \sqrt {\beta ^2 + 4} * R \sin \frac \theta2$$

Now, to get the value of $$\beta$$, I know that for $$\theta = \pi$$, shortest distance is going to be $$\pi R$$

Substituting values of $$l$$ and $$\theta$$ in the final equation, I get $$\beta \approx 2.42$$

However, this value of $$\beta$$ is not consistent with my previous equation, $$\tan \frac \beta2 = \frac \beta2$$

Where did I go wrong?

For the cut circle to actually be on the sphere, the limits ($$\theta \leq\beta \leq \pi$$) need to be in place. However there were no such limits while calculating minima, and thus it gave the answer as $$\beta=0$$
In fact, after graphing $$l$$ against $$\beta$$ on a graphing calculator, I saw that the only minima is at $$\beta=0$$, and $$l$$ increases with increasing $$\beta$$ (for within the limits we are concerned with). Hence for $$\theta \leq\beta \leq \pi$$, the minima is at $$\beta = \theta$$ !
Therefore minimum $$l=R\theta$$