Before compensation network adjustment is performed I've checked one important component in the (opto-isolated) feedback loop and that is opto-coupler LED current that define, for given opto-coupler transfer ratio, how fast changes on the output will be transfered to the PWM controller (LM5401B), i.e. it participate in total loop gain together with NFB op-amp (TL103) and PWM op-amp inside LM5041B. I was started with value for Rled (R85) that is, as we'll see, too low, and that resulted in high loop gain and over-sensitive response to any disturbance on the output - the circuit is unnecessary overreacting

. The following LTspice simulations shows how Rled affect operation. Let's start with 470R (R2 in spice model):

Reference voltage for error amp is 2.5 V therefore a small step from 2.4 to 2.6 (green trace) is used to generate disturbance. Blue trace displays how error amp (TL103 in our case, comparable LT1006 in the model) will react with used compensation network (C2 || R3+C1) and red trace show us what we can expect on the LM5041B's COMP input. Please note that OC's collector resistor R1 is inside LM5041B what can be found in its datasheet (see Fig.3, pg.9). We can see that slope is too large, and that will cause a huge difference in PWM duty ratio for the HV buck. Consequently that will cause a huge change in output voltage.
Now we can go in another extreme when Rled is too large (and consequently max. LED current is too low) and select 10K:

Here we can see that another problem arise, the error amp will not be able to push PWM duty cycle down to zero. The LM5041B COMP pin cannot go below 3 V that is more then 50 % duty ratio, what can be rather dangerous situation (for that duty cycle and high Vin of e.g. 240 Vac it will be way over max. Vout of 52.5 V). Note: the LM5041B doesn't need 0 V for 0 % duty, but it's still well below 3 V (it's around 1-1.5 V if I can remember correctly).
Finally, we can see how this "transfer" works with selected value of 3K3:

It's almost perfect - the PWM input (red) will almost 100% accurately follow the error amp response (blue)
with applied compensation network.
All three cases together, that can be generated with file in attachment, looks like this:

Now we can see how compensation network is selected. That is done empirically with assistance of scope and signal generator (I have both functionality in DS1074Z-S). The picture below shows how and where signal from generator is injected.

The R1 and R2 mirrors R81, R77 values and signal is decoupled with huge elco (3300 uF) with positive polarity connected to the feedback loop voltage divider middle point. Disturbance of 1 Vpp is selected and final testing frequency of 120 Hz.
When I started with initial compensation network (with values presented in first version of schematics) with 1 Vpp and 5 Hz I got the following response (yellow is Vout, blue is injected signal):

Overshooting and oscillations are clearly visible but converter wasn't unstable as I tested it over the whole voltage and current range. But, since compensation is far from optimal that resulted e.g. in quite visible Mains frequency ripple (100 Hz in my case) on the output. I've use the following procedure: select C(ti) and C(td) values and find right values of R(Kp) and R(Ki)1 using trimpots. The value of R(Ki)2 is changed in later stage when I got first promising results: I started with 10K and then select 5K6 without any iteration in between.
The next screenshot shows one example of overcompensated network:

When testing, I set Vout to approx. middle of range (25 V), so was the case with drawn current (2.5 A). But, be aware, even if you came to satisfying step response shape with certain combination of Vin, Vout and connected load, that doesn't necessarily mean that additional adjustment is not required for different combination of
both Vin and set Vout and Iout. Therefore I've tested again the whole range and find out that with Vin=240 Vac and Vout below 15 V output ripple is started to increase (almost doubled).
So far I found that compensation network works fine with both Vin=120 Vac and 240 Vac over the whole range. In the process I also removed two costly component: output elcos and now only 1500 uF instead of 4500 uF in total.
Step response now for Vin=240 Vac looks like this:

... and for Vin=120 Vac even a little bit better, since a little bit of overshooting is good for better output ripple figure:

The same method is also used for checking compensation network for VIPer35 that is used by manufacturer (ST) in one of their eval. boards. Output regulation is not achieved here with error amp but with simple zener diode. Therefore the signal injection point is different. In series with zener diode ground leg a small value resistor (10R) is added as an entry point for signal generator output as shown in the following picture:

For Vin=240 Vac step response looks like this (again yellow is Vout, blue is injected signal):

... and for Vin=120 Vac like this:

I find them quite satisfying and decide not to change anything here.