Let me start by establishing that his character is clearly structured in accordance with a prominent for newer Disney movies “Prince with flaws” trope, except that his flaws don’t cross the line into straight up ignorance, racism (as in case with John Smith), class prejudice (Naveen) or taking innocent people hostage even when they are old and severely ill therefore can die if involuntarily placed in a cold dungeon (Beast) hence why Flynn’s change of heart comes off as significantly more believable and organic considering the concise time dedicated to his character progression due to limitations of the film. Where the audience had to be convinced in ultimate changes of inherently problematic and initially harmful mindsets of certain male leads that reconsidered and reformed their entire mentality overnight, in most instances for the sole purpose of impressing a girl rather than due to genuine revaluation of priorities or recognition of WHY their behavior was uncalled for Flynn’s issues are exposed to the audience in order to explain why his life got off track at some point without justifying his unreasonable choices and destructive life style but rather highlighting the backstory behind them providing insight into his troubled past, lack of social or emotional support that deprived him of any perspective, his overall personality and values that were not affected by bigotry or blatant disregard towards other people’s life and safety hence him protecting Rapunzel and literally shielding her with his own body when they got in trouble in the thug pub because of his actions seeing as he was unwilling to let her get hurt even though at that point not only did he owe her nothing but would be quite glad and relieved to be let out of the bizarre deal she pretty much blackmailed him into. This is the part where the context behind his relationship with Rapunzel and the way they were set up needs to be pointed out and focused on more thoroughly. His annoyance with being subjected to fulfilling a role of a guide for rebellious teenager had nothing to do with Rapunzel’s personality or being irritated with her traits and everything to do with the fact that she took his satchel which was his key to riches and careless life where he, an orphan with no class/social privileges or so much as a helping hand in his disposal wouldn’t have to think about how to make a living anymore. And now lets fastforward to the point where Rapunzel ends up being the first person possibly in his entire life to show genuine concern and interest in his issues (the campfire scene emphasizes on this concept behind their build up, however she was more than willing to learn up on where he was from and what he was about even prior to them sharing a near death experience in a flooded cave which entailed Flynn’s moment of exceptional honesty and revealing his real name) but most importantly offering him something he has never been fortuned enough to be provided with on part of other people - acceptance. She is not being scolding or condescending or calling him out on a handful of wrong choices nor does she emulate his problematic thieving ways, instead she gets the grasp of his struggles and the motives behind them while he is listening and perceiving - something that SHE has never experienced in 18 years spent in burdening isolation with the only type of human interaction being her oppressive, passive aggressive and verbally abusive parent figure who could care less about her passions and aspirations or virtually anything Rapunzel, first as a child and then as a young curious woman, needed for personal growth such as socializing and forming bonds with people. The crucial point of Rapunzel’s dynamic with her “mother” was the latter making every conversation about herself, about how SHE is a sacrificing and loving party in their relationship and the only entity to be willing to take it upon herself to bear the cross of looking after such incapable, “vague, sloppy, chubby, naive and immature” individual. But Flynn - he deconstructs every single negative and deliberately misleading piece of unwarranted and false information provided by Gothel who was Rapunzel’s only source of knowledge since birth without even being aware of the extent of abuse and manipulation Rapunzel was undergoing for years: he is there to listen, to understand, to show that she matters, to compliment her for handling herself spectacularly when confronted with unpredictable circumstances, to make her birthday special and meaningful, to make her dream come true. And then there is the part where every “prince with flaws” usually sets out on a prolonged emotional journey of exposing his “audience” - or more specifically his love interest - to heartwrenching drama of his life or at least plays an obligatory inferiority complex card in order to invoke pity. Flynn, on the other hand, rejects Rapunzel’s sincere suggestion to share his “sob story of a poor orphan Eugene” and even when she - no, not by insisting or forcing him into talking about things he doesn’t want to but by once again highlighting her willingness to listen and understand rather than judge and patronize - encourages him to do it and the emotional outburst is seemingly bound to happen something completely unexpected happens instead - he doesn’t tell it!
He does not tell his sob story or throw a pity party or come up with an extensive list of misfortunes and painful incidents he got to endure when either losing the entire family or being abandoned or living in the orphanage - besides the brief mention of how he got his nick name which was meant to explain where the name Flynn Rider came from so that Rapunzel wouldn’t be confused because he was determined to be honest with her - or finding himself in a situation hopeless enough to not find any way to unleash his potential and make something out of himself other than falling into treacherous trap of stealing despite being a bright imaginative young man. Neither he or narrative is there to excuse his problematic behavior and instead Flynn/Eugene consciously works towards examining it due to finding someone who accepts and appreciates him for positive and appealing traits of his personality which essentially opens a new perspective for him to consider. He isn’t trying to impress Rapunzel nor does he recite an epic grandiose speech about how profound of an influence she had on him or reward her with his admirably reformed self - instead he gives her acceptance in return and once the romantic sparks start flying between them they mutually and naturally contribute to building each other up by being non-judgmental and attentive. When Flynn/Eugene goes to make amends with his former partners in crime and give them back the satchel/crown he doesn’t even mention it to Rapunzel because once again, his development isn’t incorporated into the plot for the sake of conveying a controversial message of growth being required in order to get the girl as a prize/trophy, instead his growth is presented as a natural part of his experience rather than being a yet another patronizing tale about a misguided man with excessive number of prejudices and/or abusive/aggressive tendencies inorganically deviating from his deeply embedded harmful and troubling mindsets overnight to get the girl.
And finally, slowly but steadily, the part where every “prince with flaws” gets his chance to shine and is granted a moment of exceptional heroism approaches. But Flynn/Eugene’s moment is also partially related to the events his mistakes and thieving ways inadvertently set in motion: had he not stolen the crown, tricked his allies and been chased by the royal guards and a horse with a human intelligence he wouldn’t have stumbled upon Rapunzel’s tower, the latter most likely would never have left on her own for the psychological burden carried by victim of a systematic abuse and methodical manipulation was too much of a considerable and almost insuperable obstacle to overcome without any guidance - just as the burden carried by a person rejected by the society and not provided with a modicum of care and consideration that Flynn was and that essentially drove him into thieving - they wouldn’t have set out on a life changing journey that ended up being a self fulfillment arc for either of them, Flynn wouldn’t have been captured by the guards subsequently escaping execution and finally, would not have returned to the tower and climbed by Rapunzel’s hair only to be mortally wounded by her captor. None of it would have happened. And if there is ANY flawed male lead that actually got to pay the full price for his fairly mild wrongdoings compared to instances of completely disturbing behavior most of other princes/heroes with problematic tendencies demonstrated in their respective movies it’s Flynn and no, not because he was stabbed, to be concrete, Beast was too, except that he embraced and almost welcomed death with arms wide open because getting the validation of his redemption by seeing Belle, a person he perceived as his only key to rehabilitation, coming back was enough for him to be at peace in his final moments, but Flynn desperately held on to life, in fact, he LOVED life and in many ways symbolized and impersonated it being a survivor who has seen everything. Eugene doesn’t become a hero because he was stabbed but because he consciously sacrificed his last chance at being healed in order to make sure Rapunzel will be able to go on and build her future just the way she wants to as a free person even without him. He trusted her THAT much and he valued her independence more than she did as well as above his own life. He did not perceive her as a superior entity or his way of redemption - she was incredibly and beautifully HUMAN for him, with all her weirdness, chalk stained face when she paints on the ground, excess of emotions when she’s exploring the city. And what’s so remarkably poignant is the fact that Eugene didn’t want to die, he kept struggling until the very last breath, because until the bitter end he invested in the idea of WORKING on their relationship and supporting Rapunzel just as she was ready and willing to support him without either of them having to change their core identity in order to fit into the other’s designed mold of an ideal partner but rather move on from negative aspects of their life styles, be it subjection to unhealthy dependence on a possessive/abusive parent and isolation or stealing to live (excuse the vague Aladdin reference). There were no doubts on part of either of them about one not being worthy or deserving of the other, Rapunzel did have her moment of let down specifically initiated by Gothel with the use of the same trite verbally pressuring tactic aimed at making Rapunzel feel anguishingly insecure and not good enough for being loved and cherished by anyone other than her abusive “motherly” self, but Flynn effectively deconstructed and dissolved those doubts by proving to Rapunzel that no matter how complicated the situation might be or how complicated SHE might be he was not intending to give up on her hence coming back to her tower. And it makes his sacrifice so overwhelmingly meaningful because of how strongly he clung to the idea of their future together, how much he was willing to lose and how many new beginnings he was never going to get on behalf of his beloved’s freedom and happiness.
Obviously, Disney insists on remaining a champion for producing immensely uplifting and inspirational material hence why Flynn is not deprived of his new beginning and he and Rapunzel get a chance to actually start working towards their future which was not going to be easy, especially considering the difference in social status but Rapunzel never treated Flynn as inferior - neither before figuring out her princess identity and nor after - due to his past mistakes or lack of stability in his life and Flynn is not the type to be scarred off by his girlfriend’s royal heritage (obligatory mention of the fact that he took Rapunzel to the palace where he was sentenced to death and had nearly gotten hanged so that she could reunite with her family thus willingly risking his life for the sake of her happiness again despite the fact that had the King and Queen not ended up being particularly forgiving or understanding there would have been no coming back from dead this time) just as he wasn’t put off by her stories about the psychotic controlling “mother” or glowing hair.