There's no betrayal of Luke's character by taking attachments into account and offering Grogu a choice. In fact, I have no idea where the notion came from that Lucas was presenting the Jedi view of no attachments in the PT as some sort of dogmatic flaw of the Jedi Order. I wish someone could point out to me what that interpretation is based on, because everything I've ever heard and read from Lucas suggests no such thing.
Lucas has addressed this in his director's commentaries, he's been filmed teaching his staff on TCW about it, and he's given countless interviews on the subject. There shouldn't be any confusion about why George included the no attachments concept, and how it aligns with his own personal ideology (which is rooted quite a bit in Eastern philosophy).
From one of the Rinzler books, Lucas puts it this way:
"No human can let go. It’s very hard. Ultimately, we do let go because it’s inevitable; you do die, and you do lose your loved ones. But while you’re alive, you can’t be obsessed with holding on. Because holding on is in the same category and the precursor to greed. [...]The Jedi are trained to let go. They’re trained from birth, they’re not supposed to form attachments. They can love people - in fact, they should love everybody. They should love their enemies; they should love the Sith. But they can’t form attachments. So, what all these movies are about is greed. Greed is a source of pain and suffering for everybody. And the ultimate state of greed is the desire to cheat death."
And from the Archives book (prequel version):
"They trained more than anything else to understand the transitional nature of life, that things are constantly changing and you can’t hold on to anything. You can love things but you can’t be attached to them. You must be willing to let the flow of life and the flow of the Force move through your life, move through you. So that you can be compassionate and loving and caring, but not be possessive and grabbing and holding on to things and trying to keep things the way they are."
And when it comes to Luke (from the same Archives book):
"Luke is faced with the same issues and practically the same scenes that Anakin is faced with. Anakin says yes, and Luke says no. [...]We have the scene when Anakin decides to save Palpatine and join him, so they could learn how to save Padme. The equivalent scene in VI is when the Emperor’s trying to get Luke to kill his dad so he can save his sister."
If you listen to the commentary track on the ESB disc and go to the Dagobah scene where Luke sees the vision of his friends, Lucas frames Luke's actions as a clear failure, and for much of the same reason. It's bizarre to me with so much reference material available how any of this is still considered enigmatic.