A generic nonaligned Josephson junction in the presence of an external magnetic field is theoretically considered and an unusual flux-dependent current-phase relation (CPR) is revealed. We explain the origin of the anomalous CPR via the current density flow induced by the external field within a two-dimensional quasiclassical Keldysh-Usadel framework. In particular, it is demonstrated that nonaligned Josephson junctions can be utilized to obtain a ground-state other than 0 and π, corresponding to a so-called ϕ-junction, which is tunable via the external magnetic flux. Furthermore, we show that the standard Fraunhofer central peak of the critical supercurrent may be inverted into a local minimum solely due to geometrical factors in planar junctions. This yields good consistency with a recent experimental measurement displaying such type of puzzling feature [R. S. Keizer et al., Nature 439, 825 (2006)].