Environment activation errors with zsh and existing modulefile locations

Initially discussed on Slack, loading EESSI in an environment with custom module paths configured, fails.

Steps to reproduce:

% module list
% module use --append ~/.modulefiles/
% source /cvmfs/software.eessi.io/versions/2025.06/init/lmod/zsh

Lmod has detected the following error:  The following module(s) are unknown: "EESSI/2025.06"

Please check the spelling or version number. Also try "module spider ..."
It is also possible your cache file is out-of-date; it may help to try:
  $ module --ignore_cache load "EESSI/2025.06"

Also make sure that all modulefiles written in TCL start with the string #%Module

Confusingly, running module avail after the error shows the module that failed to load:

% module avail

----------------------------------------------------------------------------------------------------------------------------------- /cvmfs/software.eessi.io/versions/2025.06/init/modules -----------------------------------------------------------------------------------------------------------------------------------
   EESSI/2025.06

and loading it explicitly works:

% module load EESSI/2025.06
Module for EESSI/2025.06 loaded successfully
Edited Jan 28, 2026 by Renato Alves
Assignee Loading
Time tracking Loading