libfdk_aac Unable to set the AOT 5: Invalid config

I compiled ffmpeg on Ubuntu following the instructions here. I installed the Ubuntu libfdk-aac-dev and libmp3lame-dev libraries.

    cd ffmpeg
    ./configure --enable-gpl --enable-libfdk-aac --enable-libmp3lame --enable-nonfree
    make
    sudo make install
    sudo ldconfig

If I try to convert a file using libfdk_aac with profile aac_he just as given in the examples here, I get an error: Unable to set the AOT 5: Invalid config. If I remove the profile the encoding succeeds, but then resulting file is AAC-LC, not HE-AAC.

Any ideas of what I could be doing wrong?

    $ ffmpeg -i sample.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
    ffmpeg version N-121815-g0ae8df5f2c Copyright (c) 2000-2025 the FFmpeg developers
      built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04)
      configuration: --enable-gpl --enable-libfdk-aac --enable-libmp3lame --enable-nonfree
      libavutil      60. 18.100 / 60. 18.100
      libavcodec     62. 19.100 / 62. 19.100
      libavformat    62.  6.103 / 62.  6.103
      libavdevice    62.  2.100 / 62.  2.100
      libavfilter    11.  9.100 / 11.  9.100
      libswscale      9.  3.100 /  9.  3.100
      libswresample   6.  2.100 /  6.  2.100
    Input #0, wav, from 'sample.wav':
      Metadata:
        encoder         : Lavf62.6.103
      Duration: 00:01:00.50, bitrate: 705 kb/s
      Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 1 channels (FL), s16, 705 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (libfdk_aac))
    Press [q] to stop, [?] for help
    [libfdk_aac @ 0x5cb047486240] Unable to set the AOT 5: Invalid config
    [aost#0:0/libfdk_aac @ 0x5cb047491a00] [enc:libfdk_aac @ 0x5cb0474c6080] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
    [af#0:0 @ 0x5cb047486780] Error sending frames to consumers: Invalid argument
    [af#0:0 @ 0x5cb047486780] Task finished with error code: -22 (Invalid argument)
    [af#0:0 @ 0x5cb047486780] Terminating thread with return code -22 (Invalid argument)
    [aost#0:0/libfdk_aac @ 0x5cb047491a00] [enc:libfdk_aac @ 0x5cb0474c6080] Could not open encoder before EOF
    [aost#0:0/libfdk_aac @ 0x5cb047491a00] Task finished with error code: -22 (Invalid argument)
    [aost#0:0/libfdk_aac @ 0x5cb047491a00] Terminating thread with return code -22 (Invalid argument)
    [out#0/ipod @ 0x5cb047491500] Nothing was written into output file, because at least one of its streams received no packets.
    size=       0KiB time=N/A bitrate=N/A speed=N/A elapsed=0:00:00.00    
    Conversion failed!

P.S. I forgot to mention that the OS is Ubuntu 24.04.