Looking at your diagram, I see what the store meant. The problem with emptying the 1 gal with water and fish into the 5 gal, then filling up the 5 gal is that you'd have to do it very slowly so the temperature changed very slowly and didn't shock the betta.
If you could put 4 gallons water into the 5 gal, then somehow stand the 1 gal on something inside the 5 gal tank so the water could get to the same temp, then tip the 1 gal over so the fish and water went into the 5 gal it would work better. Or even hold the 1 gall in there for 15 minutes, though your arm might feel like it was about to fall off at the end.
If you could put 4 gallons water into the 5 gal, then somehow stand the 1 gal on something inside the 5 gal tank so the water could get to the same temp, then tip the 1 gal over so the fish and water went into the 5 gal it would work better. Or even hold the 1 gall in there for 15 minutes, though your arm might feel like it was about to fall off at the end.