I'm having some Difficulties when doing harmonics, especially on an electric guitar, where each and every note is heard.

As I had years of experience in playing guitar, I had mastered fingerstyle guitar and some slight lead solos from riffs and scales.

But I'm not familiar with the Pinch Harmonic. Sometimes, when executing it, it was perfect in sound. But sometimes, it does not sound at all.

Any practice on how to improve this harmonics?

What I'd recommend doing is practicing the pinch harmonic by itself, rather than as part of a piece. Try using different positions for your picking hand, as this is probably what's causing your inconsistency with the harmonics. You can also try turning up the gain on your amplifier a bit, as this will make the harmonic pop out more and it will be easier for you to evaluate the sound you're getting to figure out what you may be doing wrong.
Also bear in mind that harmonics don't just appear anywhere on the string, there is a scientific explanation behind it...and my knowledge of physics isn't sufficient to answer it fully, but is has to do with where the nodes for harmonics lie in relation to how long the string is.

Notice that so-called 'natural harmonics' appear in the 5th, 7th and 12th frets and will repeat in the 15th, 17th and 24th frets, and further repeats in the same fashion off the fretboard until the string ends at the bridge. When you fret the first fret the harmonics will shift up to the 6th, 8th and 13th frets and so on. "Pinched harmonics" are just exploiting those same harmonic nodes in such as way to make the note "scream". So it's key that you find the node that you want to hit with your picking hand, which then means that you need to spend some time messing around and finding the spots. With enough practice it will become second nature, like pretty much anything.
Also, the amount of gain you have on your amp does not make the harmonic, the technique does. I'm quite comfortable at getting pinched harmonics from an unplugged electric just because I've practiced enough, the gain just helps to achieve that more dramatic effect.
There's a bit more than that in terms of fun with harmonics that I know, but I think this is a good place to start off^