One example of when such a brand rip game gets sanctions is "School of wizardry", a Facebook game. It was an alright game, but a crazily blatant rip of Harry Potter, about as blatant as one could be without having Harry Potter in the title.
Eventually, they had to completely rework the artwork & names used in the game. Now they appear to be gone for good.
So yes, you can definitely get into trouble for doing this!