fix #28006

This PR fixes the exception, when repeating a measure that will end at the end of a score.