Espanso is from the AUR. If pacman had issues uninstalling it (would have been really nice to see those error messages), you can try re-installing it from the AUR, making your package manager overwrite the existing files. As far as I know yay supports the pacman syntax, so you could so yay -S espanso --overwrite "*", which will re-install espanso (the new version) and overwrite any conflicting files it finds during the operation.