The %teamcity.build.branch%
property may not always exist (see https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html#Build+Branch+Parameters), therefore it appears to deem build agents incompatible as it would not be present.
Consider alternative property such as teamcity.build.vcs.branch.<VCS_root_ID>
. This (in my case using git e.g. ) is present and therefore agents can run.