This means that either the library (in this case, TGI and SentenceTransformers) is installed locally or on the endpoint, or the code for the template is simply buggy…
If the repository version specification does not work, that may also be a bug, but if that is the only issue, the cosine similarity should not be extremely off.
As shown below, a fairly old version of the library is used in the endpoint. Of course, it is possible to update it manually…