Friedrich Merz's bid to become Germany's next chancellor has unexpectedly failed in the first round of parliamentary voting.