As others have mentioned, transformerless power supplies seem simple at first but end up needing many components to protect other components. The power consumption of a tranformerless supply is the same whether or not there is a load, so your zener diodes will get hot. You need to allow 2 W of heat in the zener.
Tranformerless supplies are not isolated so all points could be at mains voltage.
The heat issue is something that I have seen commercial designs fail to deal with properly, and circuit boards damaged by years of running hot are quite common sights.
If you use a transformerless supply, you have to consider:-
Capacitor inrush. The 50 Ohm resistor is for that, but ronsimpson's circuit has D2 placed where there will be a huge current through D2 and C2 if the circuit is turned on near the middle of the negative cycle of the mains.
Reverse current. Now handled by D2
Capacitor discharge. R1 is there to discharge the capacitor when the circuit is disconnected.
Excess current. This is handled by the zener voltage of D2, but it will get hot.
And you have to remember that any fault in design, manufacture or within a component could cause the whole thing to fail.
Fault-finding is dangerous, because the whole circuit can be at dangerous voltages.
Also the alternative is simple, safe and cheap.
https://www.farnell.com/datasheets/1725290.pdf
£3 for one off. To be safe, all you have to do is make sure that you connect the mains input to the correct 2 pins, and then don't touch them. The rest of the circuit will be safe.
To get 12 V DC, you still need to rectify, smooth and regulate the output.
The transformer will not generate a huge voltage if there is little or no load.
If you short it out, it will get warm but will not come to any harm. (That only applies to really small transformers like the one in the link. Larger ones will overheat if shorted. )
There are still lots of mistake you can make using a transformer like that, but none of the mistakes will endanger you, and few will cause components to be damaged.