Friedrich Merz, head of the centre-right CDU, relied on support from AfD to pass parliamentary motion on migration.