The fate of deformable buoyancy-driven bubbles rising near a vertical wall under highly inertial conditions is investigated numerically. In the absence of path instability, simulations reveal that, when the Galilei number,
$Ga$, which represents the buoyancy-to-viscous force ratio, exceeds a critical value, bubbles escape from the near-wall region after one to two bounces, while at smaller
$Ga$ they perform periodic bounces without escaping. The escape mechanism is rooted in the vigorous rotational flow that forms around a bubble during its bounce at high enough
$Ga$, resulting in a Magnus-like repulsive force capable of driving it away from the wall. Path instability takes place with bubbles whose Bond number, the buoyancy-to-capillary force ratio, exceeds a critical
$Ga$-dependent value. Such bubbles may or may not escape from the wall region, depending on the competition between the classical repulsive wake–wall interaction mechanism and a specific wall-ward trapping mechanism. The latter results from the reduction of the bubble oblateness caused by the abrupt drop of the rise speed when the bubble–wall gap becomes very thin. Owing to this transient shape variation, bubbles exhibiting zigzagging motions with a large enough amplitude experience larger transverse drag and virtual mass forces when departing from the wall than when returning to it. With moderately oblate bubbles, i.e. in an intermediate Bond number range, this effect is large enough to counteract the repulsive interaction force, forcing such bubbles to perform a periodic zigzagging-like motion at a constant distance from the wall.