An astronomer living on Jupiter measures the orbits of the inner planets against Jupiter's ecliptic. Their inclinations are; Mercury 5.7 deg. Venus 2.1 deg. Earth 1.3 deg. Mars 0.6 deg. It looks like Jupiter attracts smaller planets towards its own ecliptic. If the original nebula was Oort cloud shaped, then the Sun and planets were assembled from components that had random orbital inclinations. The "missing" momentum in the angular momentum problem was used up in the assembly of the solar system
The solar system was "flat" before any planets formed.
When a roughly spherical cloud collapses, it conserves angular momentum but loses energy. This means it tends towards a minimum energy configuration for a fixed angular momentum, which is a flat disk. The planets formed in this disk and that is thought to be why their orbits are, by and large, in the same plane and nearly circular. The timescale for forming a disk from a collapsing gas cloud is much less than a million years and is a prerequisite for forming planetesimals, that then go on to form planets on timescales of 10-100 million years.
The Kozai-Lidov mechanism enables cyclic interchange between eccentricity and inclination. It cannot be responsible for making a system flat and stable.