An overdraft is money you owe your old bank, and a switch closes that account. So the new bank has to agree to lend you enough to cover it, or you pay it off before the switch happens.
HSBC says "You may be able to switch bank accounts with an overdraft, but check with your new bank first. You may have to repay the overdraft before you can switch."
Money still arriving at the old account
After a switch, payments sent to your old account are redirected for you. Danske Bank warns that "your old bank is entitled to use any funds it receives in settlement of the debt on your old account." So if you still owe the old bank, it can keep money passing through to pay off what you owe.
The debt is still there after the switch. Sort the overdraft out before the switch date.