I have many problems with my postures thoughout the whole day (bad habits and WFH), but I exercise semi-regularly.
I do stretching, running, or swimming- one or multiple of these all year.
I guess that is what saves me from back pains and other trouble despite bad postures.
Even when I didn't exercise (before age 14), I did not have any back pains despite sleeping on a very hard mattress.
Talk to your doctor and/or do a little exercise regularly. That should help. Don't start exercising with existing back pain without consulting an expert, though.