File 5.40 has two major bugs, one severely effected building packages for KaOS (kernel, Qt5 packages for example can't be build with it). There are bug reports open upstream for these issues, many distros are effected. One patch is in review, other no activity yet, so it is needed to skip this release and wait for 5.41.
As always when on build and a package is removed:
sudo pacman -Syuu