If you can get a letter from the Swedish authorities certifying that you’re OK in their eyes and will apply for an extension back in Nigeria, you should have no problems showing that and the expired residence permit.
Otherwise, to be safe, book a flight through the UK or Turkey (for example) as you’ll then be checked by the Swedish authorities when leaving Schengen.
Credit:stackoverflow.com‘