I am someone who had taken a year long break personally earlier. I would not recommend taking a break if you are super sure that you can get a job 6 months down the line if things don’t work out as you plan.
If you want to do freelancing, try getting a few clients while you are on this job. Developing a freelance portfolio is time taking and you might spend multiple months before you land your 1st customer.
To add to this hiring market is very difficult right now, and it may even worsen in months to come and in 2024 first half. So stick to your current job if you can and keep trying outside while being at job.