You have to make a distinction between good grammar and what we might call the grammar of the good. Or perhaps I should say between grammar and the grammar of the good.
Grammar is the mechanics of how language works. Every comprehensible sentence is comprehensible because of grammar. Either your language works -- conveys meaning to a reader -- or it does not. You cannot make yourself understood at all without grammar.
Then there is "Grammar", which is the study of how grammar works, and an attempt to define its operation, which, it turns out, we don't completely understand. You don't need to know anything at all about the study of Grammar in order to speak or write with grammar. In fact, grammar has to come before Grammar because you need grammar to understand anything that is said about Grammar.
Then there is the grammar of the good, which is a set of prescriptions, nominally derived from Grammar, ostensibly for the purpose of teaching people better grammar, but with the larger purpose of separating the speech of the educated from the speech of the uneducated so as to create effective barriers to social mobility. The grammar of the good contains all kinds of rules that have no justification in actual grammar, or in Grammar. Some of them even come from other languages. But just as with Grammar, you don't need to know the grammar of the good in order to write a compelling story.
What you do need to do is to become as fluent in written English as you are in spoken English. The two are substantially different. To become fluent in written English you are going to need to read and write it about as much as you had to speak and hear spoken English to become fluent in it. Which means a lot. Lots of adults just aren't there simply because they have not done enough practice to be fluent.
Unfortunately, while the lack of fluency is written English can manifest itself in a number of different ways, most of which are not actually grammatical, people who don't have a vocabulary for talking about these flaws will fall back of calling them "bad grammar". Unfortunately, this leads many to suppose that you have to go learn Grammar and conform to the grammar of the good in order to write well. This does not work terribly well, however, if for no other reason than that most of the faults people are complaining about are not actually grammatical, but are matters of convention, style, usage, or other things. Reading good books will do more to improve your fluency than reading Grammar books.
That said, the gatekeepers of the publishing world number themselves among the good. While a few have the good sense to know that a great story does not always come across the transom in the grammar of the good, many of them will use it as their first filter. If it is not in the grammar of the good, they won't read far enough to find out if is a great story.
And if the do find a great story that is not written using the grammar of the good, they will insist on editing it into the grammar of the good before they will publish it.
In short, while you don't need to master the grammar of the good in order to write a compelling story, you almost certainly need to present your story in the grammar of the good in order to get it published.
On the upside, since the vast majority of (professionally) published work is published in the grammar of the good, if you read and write enough to become fluent in written English, you will have picked up both grammar and the grammar of the good by osmosis.
This is not to say that you won't ever be criticized, since the grammar of the good is being constantly reshaped by the social mobility that it is designed to resist. Thus most of the latinate rules (no split infinitives, no ending a sentence with a preposition) which were the frontier of the grammar of the good fifty years ago are now mere ruins to be gawked at by tourists, while whole new prescriptions have grown up around things like pronouns.
But that is the writing life.