Use of diode got problem
It sounds like you are half-wave rectifying the mains when you should be full-wave rectifying the mains. There are thousands of articles on this topic on the Internet.

Figure 1. Half-wave rectification. Image source: Electronics-Tutorials.
It also sounds as though you shouldn't be doing this work on 240 V circuits with such poor understanding of the principles involved.