It's not bad per se as much as it may create more problems than it will solve to not invite them. Especially if you are inviting other cousins. If your parent is close to their parent it may cause some issues between them and they will ask why their kids weren't invited.
To be tasteful, it really needs to be an all or nothing type of thing.
It's not that uncommon to not be close to all of your cousins. I have a good 60 cousins, both of my parents come from big families and some I'm closer to than others. My dad was oldest of 10 and he has a few siblings closer to my age, their kids are young enough to be my kids.
I invited all of my cousins to my wedding, even one I absolutely loathe. Luckily she did not come, most of the rest of them did. Just because you invite these cousins, doesn't mean they will accept the invitation.
My brother when he got married didn't invite any cousins just our aunts & uncles and he's on good terms with most of them too. He had a much smaller wedding than I did.
As far as grandma in the hospital, that was between them and her. They may have valid reasons to not go that you're unaware of. Depending on family dynamics here they also could have been told they weren't welcome. My grandma really played favorites and overall treated me like dirt. She did not deserve my respect or attention, if I had to be around her due to some family event I was nice but if I could avoid her I would. When she was dying, I did not visit her. When she died, I also did not attend the funeral. I'm many things, but fake isn't one of them. Luckily she died before I got married because I wouldn't have wanted to invite her but I know my mom would have talked me into it (this was my dad's mom). I would have had a destination wedding to avoid her being able to make it.