Paradoxical behaviour of wedge on an accelerating incline

This is a standard physics problem commonly seen in many textbooks. For the top wedge to not slip on the bottom wedge, the acceleration has to be

$$g\frac{\sin\theta-\mu\cos\theta}{\cos\theta+\mu\sin\theta}\leq a\leq g\frac{\mu \cos\theta+\sin\theta}{\cos\theta-\mu\sin\theta},$$

which can be obtained from a force balance considering two cases where friction acting on the small wedge points up and down respectively. Everything make perfect sense up till this point. Great!

The thing that confuses me is the edge cases that we have to consider. For the minimum acceleration, we see that $$\mu \geq \tan\theta \implies \sin\theta-\mu\cos\theta \leq 0 \implies a_{min}\leq 0$$. This makes sense. As one slowly increase $$\mu$$ until $$\mu=\tan\theta$$, the small wedge will remain on the incline even without an external acceleration, making $$a_{min}=0$$. When $$\mu>\tan\theta$$, the small wedge will still remain on the slope, even when we pull it backwards in the opposite direction with some acceleration (as long as this acceleration is less negative than $$a_{min}$$). Hence, $$a_{min}$$ $$\textbf{smoothly transits from a positive value to a negative value}$$ as $$\mu$$ is increased.

For the maximum acceleration, we see that $$a_{max} \to +\infty$$ as $$\mu \to \cot \theta$$, as this makes the denominator: $$\cos\theta-\mu\sin\theta \to 0$$. However, as we increase $$\mu$$ a little bit beyond $$\cot \theta$$, we see a sudden discontinuity where $$a_{max}$$ suddenly jumps from $$+\infty$$ to $$-\infty$$. Let's imagine that the incline is already moving at $$a_{max}$$, and then the friction coefficient $$\mu$$ increases (while the incline is still moving) to a tiny bit over $$\cot\theta$$, and then $$a_{max}$$ suddenly jumps to a very negative value. The wedge will subsequently slip as its current acceleration is still positive, while the maximum acceleration has already gone negative. This obviously cannot be the case in reality! A greater $$\mu$$ should make it even harder to slip.

This behaviour seems to arise from the $$\textbf{sudden discontinuity in the maximum acceleration}$$ as $$\mu$$ is increased. How do we resolve this paradox?

This is simply because the final form of the answer you have provided assumes that $$\cos \theta > \mu \sin \theta$$. Specifically, if you go carefully through the derivation you reach a point where you have $$a (\cos \theta - \mu \sin \theta) \leq g (\mu \cos \theta + \sin \theta). \tag{1}$$ Now, if $$\cot \theta > \mu$$, then this is equivalent to $$a \leq g \frac{\mu \cos \theta + \sin \theta}{\cos \theta - \mu \sin \theta}$$ as you have above. But if $$\cot \theta < \mu$$, then (1) is equivalent to $$a \geq g \frac{\mu \cos \theta + \sin \theta}{\cos \theta - \mu \sin \theta}$$ and since the denominator is negative, the block will not slip for any positive value of $$a$$.
Alternately, one can see this fact from looking at (1) directly; if $$\cot \theta < \mu$$, then the left-hand side of (1) is negative for any positive $$a$$ while the right-hand side is always positive, and so (1) is satisfied for any $$a > 0$$.