Why is the angle between vector from accelerometer and compass not constant?

MEMS compasses are awful. You only get something vaguely useful if and only if:

  1. You properly calibrate for soft and hard iron errors - even then there will be errors.
  2. Don't use magnetic components nearby on the board (ie steel-containing resistors, capacitors
    within a cm or two, note most have steel end-caps)
  3. Use away from any ferrous metals (ie outside away from buildings, not in a steel box!) - this applies to all compasses

Also they produce a lot of noise, several degrees worth typically.

Having said they are awful, they are the best you can do in a small package (assuming household
rather than government budget is available).