I have an Optiplex 7040 SFF also, but it has an i7-6700 which the Dell support page says will not allow Win11 even if you do the TPM2.0 update offered. Did you have a more recent processor? (it says:
"Note: Computers that shipped with Intel 6th and 7th Generation processors (i7-7xxx, i5-7xxx, i3-7xxx, i7-6xxx, i5-6xxx, and i3-6xxx) are not eligible to upgrade to Windows 11. Upgrading to TPM 2.0 does not bypass this Microsoft requirement.)"