I don’t see an issue with that—for the most part.
If you look at Clair, Johto’s dragon-type gym leader, her fighting dojo team contains four dragon types, then gyarados and charizard. However, while they aren’t dragons, they still fit her theme.
If you’re going to be a gym leader that specializes in a single type but would like to include other pokemon like that, I’d suggest keeping your overall theme in mind. They at least ought to know moves from your type specialty.
Try to include only 1 of these type deviations if your team is any less than 6 pokemon. If you’re running a 6 pokemon team, you may bump it up to 2, but be careful. If you’re a fire gym leader, don’t use those 2 slots for electivires.
Just be smart about it, and it shouldn’t be an issue.