Everyone is prone to a power-tripping daydream now and then. It can be a fun way to kill time and generate interesting ideas for stories. If it doesn’t generate whole stories, it can be used to develop some new characters. This kind of daydream, like many things, can be an effective tool if used correctly. But it can also be used incorrectly.
Everyone has their own writing process. A nice power fantasy is as good a place to start a story as any. But by the time a writer puts it all on paper and tries to get it published, a great deal of struggle and hardship needs to be added to that starting power fantasy, or put in front of it so that the fantasy can be given out to the author and readers as an earned reward. The criticisms that get used if these conditions aren’t met are familiar: Mary/Gary Sue and (the one that I’m afraid of ) self-insert. These criticisms are valid. There is a strong resemblance between bragging and sharing a power fantasy. It may feel good for the speaker/writer but it’s tiresome for an audience.
I will go one step further and say that this kind of story is not beneficial to the writer either. Again, I like a power fantasy as a starter for a story. It gives me an idea of where I want this character to be or what kind of challenge I want them to eventually be able to overcome. But, if writers are using a power fantasy to insulate themselves from struggle or hardship, then they’re developing the mentality of a caterpillar staying in the cocoon. Dead. Worse, if the writer is prone to too much self-indulgence, it can make it more difficult for them to reflect on and improve their writing.
A struggle or conflict is where a story gets interesting for everyone. It makes it entertaining and beneficial for both the writer and the audience. A writer owes it not just to the audience, but also him/herself to put struggle into their fantasy. To see a version of themselves overcome obstacles and deal with setbacks. This way writers can use their stories to help their audience and themselves develop resilience or other virtues. Almost like a service to the community.
All this to say, authors can write their stories however they want. If they want to write characters that represent themselves, that is their prerogative and is a legitimate place to start a story or to begin developing a character. Writers are told to write what they know, and people can reasonably expect to know a version of themselves. If writers want to write a story where they are the main characters, they might as well do themselves a service and take the opportunity to make their stories interesting.
All this might not save a writer from the criticism of “this character is an obvious self-insert.” I’m not sure any writer is safe from this criticism, mostly because I believe that there is some truth to it that is intrinsic to writing. But if the story is still interesting, I don’t think the larger audience will care, and the criticism will sting a lot less.