A few examples in a video about 偏偏 (time links to examples below) use a structure that seems to be "[Question Word] + V + 不好". The meaning seems to be similar to structures like “想吃什么[就吃什么]". How does this structure work? Can any "question" go in front of 不好? Does it required a "but" clause afterward for contrast?
I wouldn't take it as a special structure. I take 什么时候出现不好 or 他喜欢谁不好 as a normal rhetorical question, denoting positive meaning. They means 什么时候出现都好 and 他喜欢谁都好. 好 is used as an adjective meaning fine, ok, good. Grammatically, 什么时候出现 and 他喜欢谁 is subject, and 不好 is predicate.
什么时候出现不好 means whenever it appears is fine and 他喜欢谁不好 whoever he likes is fine.
The rhetorical question 什么时候出现不好(compare to 什么时候出现都好) puts more emphasis which implies a but. The 'but' is often omitted as the examples you quoted.
Can any "question" go in front of 不好?
No, not all questions could go in front of it. It works well with selective questions. E. g. 去哪，什么时候，什么地方，什么人，谁, etc. In those questions, you can select who, what time, where, etc.
Why not show up some other time, but this very moment.
Why doesn't she choose/like someone else, but a man who doesn't respect her.
Key words in this structure
什么is NOT a question word, but means
any (other), so does
谁in the 2nd example.
First, this type of sentences indicates a contrast condition, so "but", "in contrast", "unexpectedly" or even "ironically" can be added afterwards (as long as it is grammarly correct, if this is what you are pursuing).
And imho, this is also a very emotional sentence or subjective expression with a tone of grumbling or judging others behind. And
不好 sounds more like a rhetorical question , like
吃苹果不好吗，偏偏要梨， so the first example sometimes also goes like "什么时候出现都好，偏偏在这个时候出现". Interesting?
什么 in this structure is not indicating question form, it is acting as a pronoun for an indefinite object
'What' in "eat what you want" means 'whatever' -- not a specific thing
'when' in "come when you want" means "whenever' -- not a specific time
不好 means 'not good'; [XXXX不好] = [say not good to XXXX] = [not choose to XXXX]
什么时候出现不好，偏偏在这个时候出现 = not choose to appear in just any moment. It has to appear at this moment
他喜欢谁不好，偏偏喜欢一个不懂得尊重她的男人 = She doesn't choose to love just anyone. She has to love a man who doesn't respect her
Does it required a "but" clause afterward for contrast?
Yes, it does
This is a very good example: Once you start using grammar to analyze an unusual sentence, arguments start and you get many different answers. Tell me why care about grammar structure, especially using so many jargon to explain to your student? Try my way: "什么时候出现" 不好，偏偏 "在这个时候出现"。
1 contents inside quotation marks are replaceable. 2 不好 is sarcastic negative, implying positive, must be w--ever as covering all except: 3 偏偏 is sarcastic positive, implying negative, "I don't approve this exception from 2. Try make few sentences out of this pattern.
Above is exactly what I taught my students: Did I use any grammar term? As long as they understand and most important of all, can imitate and use it, why get grammar involved?