Paul is not saying that the Galatians’ suffering/experience was for nothing. Instead, he is warning them in order to provoke repentance. If they move from faith in Christ to faith in Christ and works of the law, then their faith is futile and they will not enjoy the salvation that Jesus brings. All their suffering/experience will have been for nothing.1
4 Did you suffer so many things in vain if indeed it was in vain?