If you're trading on a live account with a regulated broker, there should be no reason for the broker not to pay you.

However, if you're trading on a demo account, you are not trading with real money, so any profits are unreal. The demo accounts are a sandbox where traders can test their strategies and see the trading conditions with a broker before adding real funds and opening a live trading account.

In some cases, if the broker you are trading with is not regulated and is a market maker (a.k.a., a dealing desk), they might refuse to pay your profits by telling you that you've used some forbidden trading technique or automated trading tool that they do not allow, thus refusing your withdrawal request. And will most likely cancel your profitable trades.

I recommend that traders open their trading accounts with a properly regulated broker.