Automator: replace text input not working
The problem was related to the macOS version. After updating to 10.12.1 the text is now being correctly replaced!



Edit: for those interested in the alphabetic sorting, simply add a Run Shell Script block and fill in sort -f, like so: