I made changes to the people-finder.js script to change the sort order, and locally everything works well.
To override the functionality, I used the following directory structure and Maven-based SDK to generate AMP file:

As I expected, locally everything works fine and I can see my changes:

Next, I deploy the file on the remote server, as described here: Install the AMP file
And here I do not see my changes:

Directory /opt/alfresco-community/tomcat/webapps/share/components/people-finder also contains the scripts without changes.
And thus, sorting does not work as I need.
Additional information: I unpacked the AMP file and not found there branch /web/components/... Of course, people-finder.js and people-finder-min.js is not present there also. In the AMP file, there are my other changes and they have successfully applied (labels and other small things).
What could be the reason?
I would be very grateful for the information. Thanks to all.