In states with extreme gerrymandering (where they engineer more districts to the desired outcome but by smaller margins in each district), an unexpected surge in voter turnout for the "minority" party can result in unexpected results. IIRC this is what happened in suburban Congressional districts in the 2018 midterms in "red" states.
Check out this article that describes Gerrymandering as a Risk vs. Reward Strategy:
From the section labeled "The Risk vs. Reward Tradeoff":
"For each additional district that the gerrymandered strategy attempts to win, it narrows the margins and makes the strategy more vulnerable to high Democratic turnout. The higher reward strategies come directly at the expense of higher risk."
"To sum it up, the idea behind the blue wave terminology is that the Republicans have narrow leads in a number of districts which could be flipped en masse in the event of unexpectedly high Democratic turnout. Gerrymandering involves sacrificing larger margins of victory in each district in exchange for a higher number of expected victories, and these margins can disappear to variations in voter turnout or other similar factors. This makes gerrymandered strategies inherently more risky than strategies which result in something closer to proportional representation."