Optical stellar polarimetry in the Perseus molecular cloud direction is known to show a fully mixed bimodal distribution of position angles across the cloud. We study the Gaia trigonometric distances to each of these stars and reveal that the two components in position angles trace two different dust clouds along the line of sight. One component, which shows a polarization angle of -37.6+/-35.2 and a higher polarization fraction of 2.0+/-1.7%, primarily traces the Perseus molecular cloud at a distance of 300pc. The other component, which shows a polarization angle of +66.8+/-19.1 and a lower polarization fraction of 0.8+/-0.6%, traces a foreground cloud at a distance of 150pc. The foreground cloud is faint, with a maximum visual extinction of <=1mag. We identify that foreground cloud as the outer edge of the Taurus molecular cloud. Between the Perseus and Taurus molecular clouds, we identify a lower-density ellipsoidal dust cavity with a size of 100-160pc. This dust cavity is located at l=170{deg}, b=-20{deg}, and d=240pc, which corresponds to an HI shell generally associated with the Per OB2 association. The two-component polarization signature observed toward the Perseus molecular cloud can therefore be explained by a combination of the plane-of-sky orientations of the magnetic field both at the front and at the back of this dust cavity.