Manchester City thought they had done enough to beat Brentford but conceded a late goal in bizarre circumstances