In a fluky way; with unexpected luck.
by accident, by mistake, in error (without intention to do so)
wrongly, erroneously