In the strictest sense, it is indeed grammatically correct. However, it’s not well written, and this is often misinterpreted as being equivalent to saying it’s grammatically incorrect. Consider for example the sentence ‘The old man the boat.’. A lot of people will claim this is ungrammatical, but it’s actually perfectly valid by the rules of English grammar (‘man’ in this case is a verb, not a noun, the subject is ‘the old’ (that is, elderly individuals), and the object is ‘the boat’). However, it’s difficult even for many native speakers to understand without re-reading it a couple of times (especially since ‘man’ used as a verb is less common these days than it used to be).
In your example, there is syntactic ambiguity inherent in the fronting of the subordinate clause: ‘Like Pearl was hesitant to accept her father despite being expected to’. In particular, ‘Like’ is ambiguous, it could be a filler word (similar to usage in phrases such as ‘Like really, dude.’), or it might be a conjunction that we’re missing the main clause for, or it could in theory even be a preposition, or it could even be part of a name (though this is not likely to be how most native speakers initially interpret it), and there’s no way to clearly determine this without reading most or all of the rest of the sentence, possibly multiple times (I had to read it twice to realize that it was a conjunction introducing a fronted subordinate clause). This ambiguity and the required resolution means that this is a garden path sentence like my example above, although it’s not exactly the best example of one (the ambiguity is relatively easy to resolve quickly and does not require any ‘special’ knowledge of the language).
Additionally, structure of the rest of the question is a bit complicated and sounds a little unnatural, though this is not exactly a crucial issue.
I see two ways to cleanly resolve the ambiguity and improve the structure of the rest of the question:
- Completely restructure the question to not front the subordinate clause. For example: ‘Have there been times when you did not immediately comply when society expected something of you, much like how Pearl was hesitant to accept her father?’. This resolves the ambiguity cleanly and also sounds a bit more natural, but still leaves you with a somewhat long sentence for the question, which is usually not considered a good thing stylistically.
- Completely restructure the paragraph, splitting the subordinate clause about Pearl to a separate sentence. For example: ‘Pearl was hesitant to accept her father, even though she was expected to. Have there been similar times when you did not immediately comply when society expected something of you?’. This also clearly resolves the ambiguity and sounds more natural, but keeps the example at the beginning (which I would consider preferable from a structural perspective) and avoids having an overly long question.