We give each slot a number and write them down in the order that they're used. If you haven't lost after sticking $18$ swords in, the 'bad' slot must be one of the last $6$. There are $24!$ ways to order the slots, but when the 'bad' slot is among the last $6$, there are $6\cdot 23!$ possiblities, so the chance of this happening is: $$\frac{6\cdot 23!}{24!}=\frac14$$