It seems there are several issues with building HLS 2.9.0.1 for GHC 9.8.4. The following ghcup command makes it work (thanks to @fendor):
ghcup compile hls -g b8127f7c36033a2cbc5afdd9578c3fe6cf178aa3 --ghc 9.8.4 -- --constraint="ghc-lib-parser==9.8.4.20241130" --allow-older="ghc-lib-parser:filepath" --index-state="2024-12-02T00:00:00Z"