Yes, your grandson can safely take soy formula. As long as it has adequate calcium and iron, your grandson will be fine. Formula companies are highly regulated and their quality standards are extreme so they really are safe and healthy for babies.
Of course, it is best if your daughter continues to breast feed. I would encourage her to breast feed and pump while she is giving the formula, if she would like to. Many mothers feel guilty if they do not breast feed and they shouldn’t. She is trying and the last thing you want to do is make her feel like a failure or guilty. There are many reasons that breast fed babies don’t gain weight. Many babies have trouble latching on to the breast or mothers may have trouble producing enough milk if they are on certain medications, under a lot of stress, or they aren’t taking in enough fluids or calories.
You are in a tricky spot because you want to encourage your daughter but let her parent her way, not your way. Remember, she just had a baby two weeks ago and she is tired, emotionally charged because of fluctuating hormones and may feel frightened because her baby isn’t growing. When a mother sees a child fail to gain weight, it pushes a lot of buttons in her and they aren’t good ones!
Support your daughter and encourage her, that she will get her baby to gain weight. Be positive and not negative. To answer your initial question, giving her baby soy formula is just fine.