So stacks is a separate network with its own consensus layer where a random miner from the bitcoin main chain is selected to write the next block, have i got that right?
What happens when they write something the rest of the stacks network disagrees with?
Bitcoin miners have no role here. Anyone can sign up to be a Stack-miner by bringing in their own BTC into this network. That amount (in BTC) is distributed to those who have staked their Stack-tokens. A pRNG process (based on VDF or VRF) selects one of these miners at random to create the next block
Source: https://blog.blockstack.org/realizing-web-3-proof-of-transfe...
Edit: typo
This was the primary reason why for Stacks 2.0, a hard design requirement was to make absolutely no changes to Bitcoin and to not put additional data in Bitcoin.
With Stacks thousands of STX transactions result in a single hash on Bitcoin (technically on the order of active miners on Bitcoin), so Stacks transactions automatically settle on Bitcoin every block.