Right, if they sign a qualifying free agent they lose a 2nd and a 5th. But if they keep Hoskins, exceed the tax again, and give him a QO, they get a 4th for him next year. And should they get back under the tax the pick would be a 2nd. In both cases, at the very end of the round of course.
It's a perfectly worthy thing to consider but you still have to also consider the value of Hoskins in the line-up, as well as whether you could trade him for something that might actually help the 2023 team (even if it's just a reliever - but you're more likely to get someone like that over a good prospect as the headliner in the deal in terms of salary match).
I can also see the Phillies trading someone (Hoskins included) for prospects at the deadline (or in a three-way deal) - if they do bring in someone to replace Harper, and Castellanos bounces back, and Bohm is solid, and the new shortstop has produced, they will have an extra piece (assuming Harper returns on schedule/well).