FreeCAD AppImage stopped working after Fedora 40 upgrade

I hit the same issue and was able to run FreeCAD using the following command:
LD_PRELOAD=/usr/lib64/libdrm_amdgpu.so.1 ./FreeCAD-0.21.2-Linux-x86_64.AppImage

This works even though my laptop has Intel graphics.

Hope this helps