I think the problem is you have missing {i}, i.e. row number
sheet.merge_cells(f'{pair[0]}:{pair[1]}{i}')should be
sheet.merge_cells(f'{pair[0]}{i}:{pair[1]}{i}')
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs