PWM-Switch Model of a Cascaded-Buck-Boost
By looking at this cascaded buck-boost, I believe two PWM switch models are needed and must be assembled as below:



To verify if the averaged models arrangement is correct in large-signal, I usually plot the step-load response or the input response and compare it to that of a simple open-loop-operated cycle-by-cycle model. If the average model is correctly wired then responses must be very close to each other. Please not that I did not include the PW modulator as the ramp amplitude is assumed to be 1 V hence a gain of 1.

Here, I can use the SIMPLIS demo version elements and run the complete circuit then obtain its small-signal response. The results are shown below and agree well in the operating point. The voltage is 12 V for a nearly 50% duty ratio.



Regarding the ac response, it is very close to what the average models give:



What is the next step then? As these are large-signal models, you need to replace both PWM switch models by their small-signal version and rearrange the whole circuit in an easy-to-read form. I would recommend to use a simulator first (LTspice can do well) and store the first ac response obtained with the large-signal models: that is your reference. Then replace the large-signal models by the small-signal ones. Then simplify, rearrange your circuit to make it easy for you to analyze. Each step that you take when you simplify or rearrange the circuit must be backed up by a new simulation that you compare with the reference. Any significant deviation will highlight either a mistake when rearranging the circuit or an inappropriate simplification (a parasitic term you decide to ignore etc.). To that respect, simulators are an incredible asset when doing these exercises.

Once you have a clean circuit simple and well readable, then you can start looking at its control-to-output transfer function or any other. To do so, I would strongly recommend you learn how to apply the fast analytical circuits techniques or FACTs. Simply put, you cannot beat them at execution speed and ease of implementation. It requires a bit of time and practice to acquire the skill but when you have, there is no going back. And for the DCM version? Simply replace the PWM switch models by their DCM small-signal versions and you restart the analysis. As Marko would say, "good luck"!