Starving yourself is never going to make you gain weight, what it will do is prevent you from losing weight optimally.
When you are starving yourself, your metabolism changes into starvation mode and can decrease by as much as 40% IIRC. So it means that your body will change its processes to get by on fewer calories. You'll still lose weight, but you might actually lose more weight by eating as little as possible without going into starvation mode (I read 1200 calories a day is the threshold for starvation mode for women), not to mention that you'll get nutrients for your physical and mental health as well as energy to function in daily life.
The other problem with starvation is that you will be losing muscle as well as fat (and if you are not very fat to begin with, this actually can be dangerous because your body will start using your organs including your heart for energy). In order to prevent muscle loss you need to eat enough protein as well as do resistance training. Usually what happens with starvation diets is people eventually start eating again, maybe even binging to compensate for starving, and end up gaining fat in place of the muscle they loss so their body composition worsens.
What you're doing is not sustainable in the long term, and it's just generally not very good for you. By depriving yourself of nutrients you'll not only be messing with your body, but you can give yourself mental health issues because your brain won't have the nurtients to make neurotransmitters (and if you are a student/work in an intellectual job it will harm you there too). Also, chewing and spitting sounds kind of eating-disorderish.