(Disclaimer: I have no specialized medical knowledge, and this is just
speculation.)
From the way you describe it, I wonder if you might have had a
micro-stroke. Those can be very hard to detect. When people lose an
ability from a stroke, they can sometimes get it back by just exercising
whatever's left of the ability on a regular basis, not expecting it to
be particularly good at first.
If that applies, it would suggest the remedy is to write whatever you
can regularly, not showing it to anyone if you don't want to, not
worrying about how good it is, but just exercising the neural pathways
that have to take over, writing something every day. Maybe that would
help even if no stroke was involved.
It's quite possible I'm making no sense, or that you've already tried
it. If so, sorry. But it's a thought.