If you dont stick to a bad job and leave within a few months… just don’t put that short term job on your CV. The CV doesn’t need to include anything that’d make you look bad.
Depends on how the rest of your CV looks like. If you just have short term jobs, sure it’s a red flag. If you have one ones in a while, everyone will understand that it just didn’t work out.
I've got two <1y permanent jobs in a row on my CV - first one was running out of money and I quit to save them a salary (I didn't believe in the holy grail pivot or new tech lead - company folded 2 months later anyway); second one "let me go" after they got a new tech lead that didn't agree with my approach. Neither is a red flag, both are just bad timing / luck.