Why are these two aggressive expansion penalties different? One says 40 and the other 20.9, which is it? It's supposed to be 50% off with the ex com CB. Is 40 a bug?
The aggressive expansion value on the left has been recently changed to show the highest AE you will incur with a nation (so if, say, France would take -21, Burgundy -25 and Austria -30 it would show -30) while before it used to show the base AE.
My guess is that the text of the peace deal has not been changed to show the maximum incurred AE and is still showing the base AE.
Correct on both counts:
In the 1.19 patch, the number on the left was changed to be the
maximum AE you incur (which happens to be a useless number, as the maximum is typically (albeit not always) incurred
only on the target you're taking the land from, and they're going to be under truce anyway) whereas the AE in the text description is still the
base (i.e. before it gets modified per target) amount of AE (so 0.75x if taking land vs. 0.50x if vassalizing, times development, times CB, times AE reductions, times administrative efficiency). This is why the numbers disagree. As for the reason why one is almost twice the other, the maximum is typically +0.50x for same religion, +0.25x for same culture group, and +0.25x additional for same exact culture, resulting in a 2x modifier to the base.
Hover over the 40 to see what you're actually incurring (albeit only on targets that would be eligible to join a coalition from this peace deal due to resulting AE total >50 and resulting opinion <0).
Peace screen shows you're taking 51% OE, which means 51 dev. 51 * 0.75 (land) * 0.50 (CB) = 19.125 AE before modifiers. Assuming not all of the land you're taking is eligible for the CB (I notice you're paying 33 dip which is 11 dev worth of unjustified demands if you have no reductions), that would explain the missing portion; I get 20.925 if I assume 11 dev isn't eligible and you have 100 prestige (or a ruler with Careful trait).
tl;dr: 1.19 made a stupid change,
@tre3qwerty summarized it nicely, and your AE looks correct to me.