Please explain input shape in Keras
Dense layers doesn't reduce dimensions of inputs, so if you provide a (12,2,3) input, it expects a (12,2,1) output (for your case).

If you want to make it work, you should flatten your input (or output of first layer) and provide a (12,1) output.