Switching to hostnames leads to "Could not match supplied host pattern"

This is by design: “When you define variables in a play, they are only visible to tasks executed in that play”.
In this case, you have a playbook consisting of five plays. The “sync_src” variable, defined in the first play, is unavailable to the remaining plays.