did shiro and grim have a rivalry when shiro came into the picture?
It's all one-sided from Grim's end though, no matter what Grim says about it.
Shiro treats Grim as a rowdy brat that needs to be watched over and disciplined when needed, but otherwise doesn't take him too seriously.
While Shiro is actually concerned when he noticed Grim eating crystallized blot, purification is unfortunately, not Shiro's expertise, that goes to his sister, the Red Phoenix (Who's with her own master).
But generally, Shiro see's Grim as a rowdy, sassy lost child who always end up biting more than he could chew because of his attitude.
Grim though, see's Shiro as taking Yuu (Rei)'s attention and position as "Yuu (Rei)'s boss" away from him. (Brat cat is attached, even if he said otherwise)
In short, Grim feels challenged by Shiro, even before Shiro reveals his true form as the mythical White Tiger in disguise, while Shiro see's Grim as a brat who still needs a lot of growing up.
There is going to be some improvement by Book 3 though.
Book 3 is a tipping point to their respective relationships with Yuu (Rei) and of each other, so due to some planning changes, I'm speeding up the when to Shiro forming an official pact and bond with Yuu (Rei) as the White Tiger.
Book 3 involves Grim learning to accept that Yuu (Rei) is her own person and he won't always be with her forever, and also learn to stand on his own feet since unlike canon MC, Yuu (Rei) is much more independent and assertive in what she wants to do than canon MC, which negatively affected Grim's hidden issues of loneliness and insecurity over his own abilities while worrying if he could stay in NRC and fulfill his dream.
Shiro, meanwhile, oversees Yuu (Rei)'s growth on the side and eventually steps in to hint his true identity and support Yuu (Rei)'s new life and journey in Twisted-Wonderland.
Though, granted, part of what convinced Shiro to accept her was because Yuu (Rei) is the granddaughter of one of his former master's, but Yuu (Rei) proved well enough that she had what it takes to handle the pact and the responsibilities that come with using Shiro's powers and aid responsibly.
By Book 4 and onwards, Shiro and Grim's relationship improved for the better and Grim tolerates Shiro more by then and doesn't try to prove himself over Shiro as much as he used to in an attempt to show who's the "boss".