We present a detailed time-resolved photometric study of the ultracompact X-ray binary candidate 4U 1812-12. The multicolor light curves obtained with HiPERCAM on the 10.4 m Gran Telescopio Canarias show a ≃114 minute modulation similar to a superhump. Under this interpretation, this period should lie very close to the orbital period of the system. Contrary to what its other observational properties suggest (namely, persistent dim luminosity, low optical-to-X-ray flux ratio, and lack of hydrogen features in the optical spectrum), this implies that 4U 1812-12 is most likely not an ultracompact X-ray binary, which is usually defined as a system with an orbital period lower than 80 minutes. We discuss the nature of the system, showing that a scenario in which 4U 1812-12 is the progenitor of an ultracompact X-ray binary may reconcile all the observables.