Gasly was announced as moving up to RBR once Ricciardo announced he was leaving, kvyat was signed to replace him. At the time the second driver was unnamed, Hartley was, well in contention but really they were looking for a replacement because he was crap. Albon signed for FE this season because he wasn't at the time directly in contention for a seat. If Ricciardo didn't leave, then most likely we wouldn't have seen Albon in F1 this year, not Kvyat. Kvyat was the first guy they turned to once they knew they needed another driver after a year of good reports from his work with Ferrari and getting back into his driving groove.
As for why they told Gasly he had a seat, sometimes drivers under pressure need a kick in the butt to perform and sometimes they need some confidence that their seat isn't under pressure, sometimes both.
IE the team tell him he must improve and soon or he won't be around in 2020, but that his seat is safe. If they tell him to improve but he's only got 2 races left then he thinks he's basically got to win, tries to win everything in a last ditch attempt at T1 (think Kvyat, Russia 2016) and actually does worse. If he thinks I have to be more aggressive, but I have 11 races left, he still needs to be more aggressive throughout a race but he's less likely to try to divebomb everyone in the first corner.
There is a fine line between offering confidence and telling a driver if he keeps performing like he is, he's done. RBR did nothing wrong, to tell him he had 2 races to save his career would have been even more pressure making it even harder to perform, to not tell him he needs to improve at all is to make him think he's doing enough to keep his seat. Fact is you don't ultimately know which way any given driver will react to any type of encouragement. Some people need a boot in the behind to get to work, some people need a gentle nudge. Imo they tried the gentle, we won't replace him, but we expect improvement through the early part of the season and then around Silverstone they added a he needs to take a drastic step or we'll have to consider our options, then he put in his first and only decent performance and they pushed to a his seat is safe but in context of that Silverstone performance. He then performed exactly as he had before in Germany and Hungary giving them very little choice.