Hello:

locate-library incorrectly generates a set of suffixes to extend the
base library name (".elc" ".elc.gz" ".el" ".el.gz" "" ".gz"), while it
should be just (".elc" ".elc.gz" ".el" ".el.gz") when nosuffix is
nil. This leads to spurious paths found, like name.gz. I found
this issue because (locate-library "tramp") was returning
"/home/alex/.emacs.d/trump" not "../lisp/net/trum.elc". The workaround
is (locate-file "tramp" load-path (get-load-suffixes))

Best,
Alex