What happens if a fee is not enough? Who will CPFP the transaction (that will cost a lot)?
Any participant can CPFP a stuck coinjoin, but it's disproportionately costly to attempt since they pay for the other participants. If you have a stuck coinjoin, you can double spend it by using a Libre relay node to duck under the BIP125 pools pinning your transaction: https://github.com/petertodd/bitcoin/tree/libre-relay-v27.1
Also, I think for channel opening there won't be a privacy benefit, because gossip announcement channel size can be easily correlated with coinjoin input.
The privacy benefit of coinjoining before onboarding to Lightning is that your channel UTXO can be known to anyone without them being able to see where you originally received funds on chain.
If you have a channel opened to you from an LSP, then you coinjoin after you close it so no one can link your previously used addresses or future on chain payments to your Lightning activity.
Re: Libre Relay, people might be interested in my bitcoindev mailing list write-up on how it has been used by LN nodes to get pinned transactions unstuck: https://groups.google.com/g/bitcoindev/c/n2GNmnz0btw The Lightning protocol does have a few remaining transaction pinning vulnerabilities, so anyone running a LN node should consider running Libre Relay.
F2Pool has, so far, been the main pool fixing transaction pinning. I believe this is due to them having a shorter than usual transaction expiration time on their nodes; I don't think they're running replace-by-fee-rate itself.
A coinjoin with a fee that is too low is basically a case of accidental transaction pinning.
reply