The Prequels were written in such a way that I’m often really not sure if certain actions are just the result of George Lucas being weird and out of touch, or the result of Lucas actually trying to send a message to the audience. The behavior of the Jedi is probably the most significant example. Many fans take it for granted that Lucas intended the audience to see the Jedi order as incredibly flawed, particularly in regard to their overly dogmatic fear of attachment. But the movies never really explicitly confirm this. There’s no “reckoning”, no scene where Yoda or Mace Windu says something like “oh my God we were wrong about that attachment thing”, etc. Certainly, you could interpret the fact that Anakin fell to the dark side, in part because the Jedi forbade him to see the people he loved (his mother, Padme, etc.), as evidence that the film is telling us the Jedi are extremely flawed. But you could just as easily interpret the movies to be suggesting a failure on Anakin’s part. That is, if only Anakin had learned to properly forgo attachments, he wouldn’t have fallen to the dark side - thus his fall vindicates the Jedi dogma. I mean you could interpret the whole plot of ROTS as vindication of the no-attachment rule.
If we take Return of the Jedi into account, we remember that Luke’s love/attachment to his father ultimately saved the day. But ROTJ was written before the anti-attachment rule even existed in Lucas’ head, so I’m not really sure if the ending of ROTJ is supposed to (retroactively) condemn the old Jedi order. And then we have ESB where Luke’s attachment to his friends results in a disaster.
Anyway, I’m like 60% certain that Lucas meant to portray the Jedi as highly flawed, but it’s by no means obvious to me by the way the stories are written.