Usually the target cursor has to be the 3 pointy arrow in order for you to switch action bars. If it's spinning circle, you can't select action bar. I usually turn my cursor from spinning circle into 3 pointy arrows by hitting enter key on my keyboard.

It's possible to be locking on a target but action bar is not activated.

I have disabled "auto lockon" because I usually have to TAB to change target during battle often. I found it easier to control my targeting this way.

Also, sometimes though rarely, when I'm engaged in a battle, my action bar might get "stuck" and wouldn't change no matter how I tried. This problem usually ends when I kill the current enemy and target myself, make the cursor become pointy, and try to switch action bar again.