Well, this is a certainty: If you have to deplane at GRU and get on a domestic flight, you will certainly go through customs and immigration at GRU. Therefore, you will have to get your bags off the carousel and physically walk through customs. After this, you would have to re-check your bags with the airline if you were to continue on to Curitiba.
If this is a technical stop where you are just landing at GRU for refueling, then you would not go through customs here as no one would be getting off the flight. Refueling would make no sense, however. Curitiba is close to BA than São Paulo. But perhaps there would be another excuse? I don't know.
Also, sometimes it is common for people to deplane at GRU, and if you continue onto another destination you would just stay on the plane. This would mean that your baggage would stay on the plane, as they would hold all the passengers' baggage who continue on to Curitiba.
So, you need to find out is if the final destination for Flight #00000 is GRU and that everyone will be deplaning. If that's the case, then I can't see why you wouldn't be able to go through immigration, get your luggage, go through customs, and exit the airport.