my cello sonata uses this principle.
it's a "theme" and variations, which encompass the 4 movements of a standard sonata form, but the entire thing also stands as a single sonata-allegro architecture.
the theme and first 2 variations are the "sonata allegro" for the 4-movement form, but are also the exposition of the larger sonata-allegro form.
the 3rd variation is a link to the next "movement" (and functions as the "cadenza" of a concerto), and starts the development of the single-movement form.
The 4th and 5th variations are the scherzo "movement", and are part of the development of the larger form.
then there's an "interlude" and the 6th variation which are the ternary adagio movement. this is also part of the development section of the single-movement form. This 6th variation is also the first time that the "real" theme of the entire sonata is played as one unified theme (it is split into two parts as "theme A" and "theme B" in the opening "movement" and treated as two independent themes... except in reality it is a single phrase, composed as a single phrase, and meant to be "complete" in that form).
And the 7th, final variation is sort of a rondo where material from earlier in the sonata returns, thus functioning as a recapitulation for the "larger" sonata-allegro form, and as the "stand alone" Rondo finale of the 4-movement sonata-form