We propose a common-envelope evolution scenario where a red giant branch (RGB) star engulfs a planet during its core helium flash to explain the puzzling system WD 1856+534, where a planet orbits a white dwarf (WD) of mass M WD ≃ 0.52 M o˙ with an orbital period of P orb = 1.4 days. At the heart of the scenario is the recently proposed assumption that the vigorous convection that core helium flash of RGB stars drive in the core excite waves that propagate and deposit their energy in the envelope. Using the binary-mesa stellar evolution code we show that this energy deposition substantially reduces the binding energy of the envelope and causes its expansion. We propose that in some cases RGB stars might engulf massive planets of ⪆0.01 M o˙ during their core helium flash phase, and that the planet can unbind most of the mass of the bloated envelope. We show that there is a large range of initial orbital radii for which this scenario might take place under our assumptions. This scenario is relevant to other systems of close sub-stellar objects orbiting white dwarfs, like the brown dwarf-WD system ZTFJ003855.0+203025.5.