Two HC-05 modules won't stay paired

Don't forget that the HC-05 is a 3.3V only device, and a voltage divider or logic level shifter is required when connecting it to a 5V Arduino. See these tutorials: https://www.martyncurrey.com/