When Thor says those two stones are safe on earth, and with the Avengers, he may just mean that they’re on the same planet as the Avengers, and will thus be protected by them (even if they don’t currently possess the Time Stone).
It’s also worth remembering that Thor is King of Asgard — in his mind, earth is probably somewhere he occasionally goes, and the Avengers are lucky people who get the honour of fighting with him when he does. He may have assumed Strange, who he met in Thor: Ragnarok, was part of the Avengers because he’s from earth and has powers - he’s King of Asgard, he’s not checking the membership rosters personally. (As his “he hasn’t fought me!” comment about Thanos a little later suggests, he’s not really a details guy.)