How can a parliamentary democracy prevent parties from becoming too de facto powerful at the expense of the de jure independent MPs making up parliament?
In parliamentary systems, the government proposes legislation which parliament then approves or not. Potentially parliament can also initiate legislation. Usually the government "has a majority in parliament", meaning that the one or more parties making up the government have a majority of parliamentary seats.
In the September 2019 suspension of rebel Conservative MPs in the United Kingdom, 21 MPs were suspended from the party for not toeing the government line. Although some tried to run as independents or for another party, all who remain suspended lost their seat after the next election.
To me, this seems a somewhat chilling attack on the independence of parliament: follow the government line or you'll have a very high risk of losing your job at the next election. This applies both in district-based first-past-the-post systems, such as Canada and the UK have, or in party-list proportional-representation systems, such as are common in continental Europe.
How can a parliamentary democracy, in which (almost) all MPs effectively depend on the party infrastructure to keep their position, prevent parties (or party leaders) to become too powerful and threaten the independence of parliament, which is (at least in theory) meant to be sovereign?