It’s true that the Sun is losing mass, both directly through the solar wind and indirectly through the conversion of mass into radiated energy via nuclear fusion. It’s also true that the only thing holding the planets in their orbits is the pull of the Sun’s gravity, which gets weaker as it loses mass. But the loss rate is so small, in relation to the Sun’s total mass, that it can be ignored in practice. In a million years, the orbit of Neptune- the outermost and least tightly bound planet- only increases by about 40 metres.