I have a different understanding of that history. In his separate dissenting opinion in the Slaughter-House Cases, a 5-4 decision, I think Justice Bradley clearly stated the central idea of the doctrine of substantive economic due process more than thirty years before Lochner:
The granting of monopolies, or exclusive privileges to individuals or corporations, is an invasion of the right of others to choose a lawful calling, and an infringement of personal liberty. It was so felt by the English nation as far back as the reigns of Elizabeth and James . . . . In my view, a law which prohibits a large class of citizens from adopting a lawful employment, or from following a lawful employment previously adopted, does deprive them of liberty as well as property, without due process of law. Their right of choice is a portion of their liberty; their occupation is their property. (my italics)
The Court in Lochner cited Allgeyer v Louisiana (1897) as authority for the proposition that "The general right to make a contract in relation to his business is part of the liberty of the individual protected by the Fourteenth Amendment of the Federal Constitution." Recognizing the other side of the argument, Lochner cited Mugler v. Kansas (1887) for the proposition that "Both property and liberty are held on such reasonable conditions as may be imposed by the governing power of the State in the exercise of [its police] powers, and with such conditions the Fourteenth Amendment was not designed to interfere." The Lochner majority further acknowledged that "This Court has recognized the existence and upheld the exercise of the police powers of the States in many cases . . . . Among the later cases in which the state law has been upheld by this court is that of Holden v. Hardy."
Allegeyer, Mugler, and Holden were all important cases in the Court's development of the substantive due process doctrine. So were Munn v. Illinois (1876); Santa Clara County v. So. Pacific Railway (1886); and Chicago, Milwaukee, and St. Paul Railway Co. v. Minnesota (1890). Lochner, in 1905, may mark the point at which the doctrine of substantive economic due process first burst into full bloom, but the buds had been forming during the three decades before that.