The product engineer designed, built, and tested the product with a specific set of power requirements. Depending upon the product, durability and safety tests were run using a certain set of power cells and a specific recharging circuit (if applicable). A lot of time and resources were spent validating the performance of the product with those batteries.
Now, let’s look at batteries. We say a AA battery is 1.5 volts, but there is so much more to it. Here is a Spec sheet for a typical AA Battery. How much current does it deliver and what voltage? What is the initial full charge voltage? What is the voltage decay curve? How quickly does it self discharge?
If you mix batteries you do not know what you are getting. It might be ok. It probably will be ok. But one of them might be old or a different chemistry or have a different discharge rate. That can cause an imbalance that might reduce performance or produce extra heat.
It is safer to keep them all the same.