So sorry this has happened - it must have been terrible the second time it happened. I think it sounds like just bad luck and maybe there was something wrong with them. Please don't let this put you off. I'm glad you came on here, because it's good to have support and advice before you get a hamster so everything is in place properly when they come home and any unusual activity can be dealt with quickly. But it does sound like this was going to happen anyway.
Sometimes hamsters have genetic defects from breeding (or lack of breeding!). They can also have falls if the cage is too high. Any change of environment can be stress to a hamster - eg coming home to a new cage from the petshop with a new environment and sometimes they have never even seen a wheel before. It's usually advised to leave them to settle in for 2 or 3 days (which you probably did anyway) and then not clean anything for a couple of weeks as they find this stressful. But even if you didn't do that it is not likely to cause death to a hamster!
I would suggest - either an adoption through the RSPCA (ie a pet that has been abandoned - I know you did this through pets at home but there are a fair few stories about hamsters being sold that haven't had proper health checks before sale and have already contracted something). Or to get a hamster from a breeder which is healthy and already partly tame.
For next time - check cage on here first (so you don't have to change cages within the first few weeks if it is too small - which most commercial cages are) and set up (tall cages have fall risks) and bedding material (fluffy bedding can cause internal blockages or cut off circulation if it winds round limbs). And we can help you monitor the first week or so. I had a lot of support on here when we got our Syrian and I had no idea what I was doing lol. He had to have a cage change in the first few weeks and he also had a fall - but he didn't die. So you have done nothing wrong. Now it is getting colder it is important to keep them warm, either through heating in the room or some kind of heat lamp or similar when the heating is off, but that clearly wasn't the cause here as they tend to go into hibernation when they are too cold (and often don't recover from this) but you'd have known about it then.
Cage needs to be minimum 80cm by 50cm for a Syrian and 70cm by 40cm for a dwarf approximately. Those are minimum floor area sizes recommended by RSPCA, but most people try to go bigger if they can. Hamsters are better in low cages so they can't fall too far if they climb to the roof - unless there is a full level of shelves or overlapping shelves and no fall greater than about 25cm to the shelves. Wide and low is the best set up. Most substrate/litter sold in the Uk is ok - pine shavings in the Uk are kiln dried to remove most of the phenols, but many people choose to use a non pine substrate still - Hemp and Fitch paper bedding are popular choices (Fitch is like Carefresh only much cheaper and no dust). Some hamsters can be allergic to some beddings too - but this would more likely show in sneezing and skin problems. Although pine and cedar bedding are believed to cause health issues in hamsters, this is supposed to be a slow gradual process and not an immediate one, and cedar bedding is the main culprit (mainly sold in the US I believe).
Foodwise, you can't go wrong with Harry Hamster mix as they seem to eat most of it, but for dwarf hamsters most people use a specific dwarf mix like Burgess dwarf hamster food. Supplementing with a small piece (really small! like 1cm cube) of veg every other day is also a good idea. I also supplement with a variety of things - different ones on different days - a piece of cheese, a monkey nut, half a brazil nut, oat treats and so on. But a good basic hamster mix and a bit of veg is the main thing. Plus changing water every day or every other day is ok unless it is really hot weather.
It sounds to me like both your hamsters had health issues that hadn't been spotted - and when people get an additional hamster, they often quarantine them away from their current hamster/s for a couple of weeks just to make sure there is no illness that can't be passed on.
I'm so sorry you've lost your two wee ones x
Is this the first time you've had a hamster? Sometimes for a first hamster, it can be a good idea to get a Syrian - they are less fast and are considered to be a bit easier (some may disagree!) to tame and handle and they tend to have less health issues as pet shop hamsters. Sadly many dwarf hamsters have genetic issues and are usually hybrids and not 'true' campbells or winter whites and the breeding is not always good if they're from a pet shop. I'm not sure about Roborovski's. Hybrid dwarf hamsters can have all kinds of genetic issues. I haven't heard of this with Robos though. It sounds like your little robo may have had a heart attack or a stroke and this can happen at any time - maybe he was older than they said.
Anyway - onwards and upwards. Come back and show us the cage and we can advise on a suitable cage (if it isn't already) for next time. All they need is a good cage, a house or hide to build a nest in (somewhere dark to go to), lots of deep substrate - minimum 3 to 4" and lots of torn up strips of white toilet paper for nesting material (paper is the safest), a suitable sized wheel and a few toys for enrichment. Plus food and water. Not placing the cage next to a window either (although ours is on the floor below a window which is ok as it's not direct sunlight).
Hamsters are very sensitive to smells and disinfectant can be quite strong for them - so it is best to rinse it well afterwards and air it a bit for a day to make sure it doesn't smell too much. But this isn't going to kill them, just aggravate them. Using a tablespoon of vinegar in a bucket of warm water can be a good way of disinfecting a cage. But again give it a good rinse and airing afterwards. I've found the vinegar smell can linger a bit too but isn't quite as bad as perfumy smells!
Condolences for your losses x
I found this cage cleaning video by Erin's Hamsters really helped - and have now changed how and when I do cage cleaning - hamsters tend to find cage cleans stressful so minimising them can help (again this is not going to have killed your hamster but it is good to avoid stressing them) - for next time x
https://www.youtube.com/watch?v=5jVnEjrXbww