I’m on TrueNAS 25.04 and tinkered around with HDD sleep some time ago. It worked for the most part. However, TrueNAS has some built-in periodic maintenance tasks, executed at system start and every 24h after that, which wake up all the HDDs. See Timing of Periodic Mainteance Tasks on TrueNAS Scale for details.
If HDD sleep is fixed, it would be nice to also take a closer look at these maintenance tasks. I have a setup where my HDDs would only wake up once a week. I’m sure there are a lot of other users who would benefit from this as well.
Edit:
I just learned that this is because of ZFS dataset encryption.
If you are using ZFS dataset encryption, the disks will spin up every 24hours as the sync_db_keys job triggers a write to the pool.