If you have gas buildup in your stomach then yes it's very normal to fart at night and in your sleep.
There's nothing wrong with farting in your sleep but you can take some Beano or other gas reducing supplements to reduce the gas in your stomach and prevent yourself from farting in the night.
Also when you lay down and sleep the anal sphincter relaxes slightly when gas builds up which causes you to fart which is very normal.