Historically I’ve used tcx files rather than gpx when riding brevets.
I used a site called bikehike.co.uk (go to course creator).
When you load in your gpx you can resample the elevation data and drill down into sections.
Not sure about gpx but with a tcx you can add coursepoints and specify a prompt that you will get popping up on your Garmin.