I'm looking for more flexibility in my work
Being self employed is great for that.
and getting out of parts of the corporate culture that I have grown to dislike.
And worse for that, since self employed developers have to do a lot of sales and contract work - and also have to navigate all of the sales and contract bullshit of each customer.
One approach is to do a year or two with a development contracting firm, to see how it suits your tastes, and learn the ropes.
I did, and I was glad to get close enough to learn the ropes and discover I didn't care for it, before leaping in headlong. I might still try it again as a post-retirement gig, at some point.
Source: perspectives from independent contractor developer peers and my own time joining and then running a development consulting practice.