Are you working with a dietitian?
When you're actually underweight and struggling to gain weight, all the things you learned about losing weight go out the window. For example, if you're avoiding carbs, you need to stop. If you're watching your fat intake, that too needs to stop. As @ShoppGirl said, this does not mean you should eat junk, there are plenty of healthy carbs and fats you can add to your diet. Do a google search for things like "healthy calorie dense foods". You'll see nut butters and avocados, but also dried and fresh fruits, whole grain breads, potatoes (sweet and white), oatmeal, full fat dairy, pasta, etc...