On the man page of the device each new Activity Profile is added in random order to the existing ones.
There's no way user could control the order of the Activity Profiles on the device.
To get the order you want, you have to play luck, adding and deleting the profile, till it's added on the position you want. Could take more dozens tries.
On the Edge 830 the Activity Profiles were sorted alphabetically in the main page and in the list of profiles in the settings, so you could name your profiles with that in mind like "01 road", "02 gravel". On 840 this is not the case anymore. Though the profiles on the 840 are sorted alphabetically in the list, on the main page the order looks to be totally random
Garmin, please allow the users to rearrange the profiles as they want, or at least bring the alphabetical sort order back.