The pre-built sharp versions do not include HEIF (particularly, not HEIC, see https://github.com/lovell/sharp/issues/4132#issuecomment-2178591889). Note that the web page for sharp doesn't claim it can do HEIF, and https://sharp.pixelplumbing.com/api-output#heif states "Support for patent-encumbered HEIC images using hevc compression requires the use of a globally-installed libvips compiled with support for libheif, libde265 and x265."
You can build it yourself - there are instructions at https://sharp.pixelplumbing.com/install#building-from-source which should be enough to enable it.
Note that HEIF doesn't necessarily mean HEIC, but that is usually what people expect to see.