I tried to get
/2.0/repositories/{username}/{repo_slug}/branch-restrictions
but it returns empty values. I checked
/2.0/repositories/{username}/{repo_slug}
and this endpoint works ok and returning value.