Sometimes right-clicking on magic mouse does not work

I have that problem too. You are not right-clicking on the correct position on your mouse. You should play with it and make a note or put a mark on your mouse to show where on the mouse you need to press to get a right-click. I found placing your finger on the right side of the mouse near the edge and towards to top works best for me.