No pairs left
The message is not a loss. It means the remaining tiles are hiding each other, and it is time to shuffle.
Why it happens
When the last tiles cover one another, every candidate is either buried or squeezed. The board is not broken — it is just locked.
What shuffle does
It keeps the same positions but gives the remaining tiles new faces, dealt backwards from a solution. The new board is guaranteed finishable.
Avoiding it
Do not leave isolated tiles in corners, and do not take a pair just because it is visible. Free the layers first.