We use failure conditions to check for text when building. When these conditions are met we immediately stop the build but we have a step at the end to email the user if they had a failure of success. This email step is a powershell script that checks `//build/problemOccurrences/@count` and if the count is greater than 0 we treat the build as a failure. Unfortunately when this step runs the problem occurrences will be 0 but when I run the script immediately after for the build id we will get back the correct amount of problem occurrences. Also we only see this issue when our angular step triggers the failure conditions, other steps will not cause the same issue.
We are on version 2019.2.4 (build 72059) of teamcity.