I had the same problem: the buttons didnĀ“t work and it only could be used while charging.
I opened the jbl flip 3 and found out that the battery got wider due to degradation and was pushing upwards the buttons causing them not to work. I changed the battery for a new one and it now works perfectly fine.
It seems that is a design flaw and that many jbl flip have this issue at 2-3 years of life. I have two of them and both had the same issue.
I hope this can help others!