There’s no contradiction. Wait and see.
The story of the elders who didn’t come to the meeting but prophesied anyway starts at Numbers 11:16. The background is that all the people of Israel were complaining about not getting good food like back in Egypt, and are we there yet? Moses complained to God about how everybody was getting on his back about it, and God decided to provide more than one back for people to get on.
"And the Lord said to Moses: “Gather unto me seventy men of the ancients of Israel, whom thou knowest to be ancients and masters of the people: and thou shalt bring them to the door of the tabernacle of the covenant, and shalt make them stand there with thee, that I may come down and speak with thee. And I will take of thy spirit, and will give to them, that they may bear with thee the burden of the people, and thou mayest not be burdened alone.”
"And thou shalt say to the people: “Be ye sanctified: tomorrow you shall eat flesh: for I have heard you say: ‘Who will give us flesh to eat? it was well with us in Egypt.’ So the Lord may give you flesh, and you may eat: Not for one day, nor two, nor five, nor ten, no nor for twenty – but even for a month of days, till it come out at your nostrils, and become loathsome to you. Because you have cast off the Lord, who is in the midst of you, and have wept before him, saying: ‘Why came we out of Egypt?’”
Heh. Had to quote that part. “You’re going to eat meat until it’s coming out of your nose! Till you get totally sick of it!”
Anyway, you get the standard Moses questions about logistics, and then God answers:
"And the Lord answered him: “Is the hand of the Lord unable? Thou shalt presently see whether my word shall come to pass or no.”
“Moses therefore came, and told the people the words of the Lord, and assembled seventy men of the ancients of Israel, and made them to stand about the tabernacle. And the Lord came down in a cloud, and spoke to him, taking away of the spirit that was in Moses, and giving to the seventy men. And when the spirit had rested on them they prophesied, nor did they cease afterwards.”
So Moses possibly becomes somewhat less prophetic because he complained too much, and the influential people of the tribes who didn’t stop people’s complaints are suddenly all prophets themselves, thus splitting up the burden of complaints. Subsidiarity.

You will notice that prophetic powers are not exactly being presented as all joy here…
The passage goes on:
“Now there remained in the camp two of the men, of whom one was called Eldad, and the other Medad, upon whom the spirit rested; for they also had been enrolled, but were not gone forth to the tabernacle.”
It doesn’t say they were sick, either. These guys missed the meeting on purpose. Lazy? Afraid? Just running late? Probably they were purposefully avoiding the Lord, possibly because they thought they were going to be smote. Smitings did happen around the tabernacle, to be fair. But you can’t evade the Lord on this sort of occasion, or the authority of the people He puts in charge of religious stuff. The Lord came and got Eldad and Medad, and they found their peaceful day broken with prophecy.
*"And when they prophesied in the camp, there ran a young man, and told Moses, saying: ‘Eldad and Medad prophesy in the camp.’ Forthwith Joshua the son of Nun, the minister of Moses, and chosen out of many, said: ‘My lord Moses, forbid them.’ *
"But he said: ‘Why hast thou emulation for me? O that all the people might prophesy, and that the Lord would give them his spirit!’
Given that we’ve just had prophecy presented as not all fun and games, and given that the Lord came and got Eldad and Medad from where they were hiding and shirking… I think that Moses is being just a tad bit sarcastic here. If everybody were a prophet, Moses’ problems would be over, and everybody else’s would have begun.
And Moses returned, with the ancients of Israel, into the camp. And a wind going out from the Lord, taking quails up beyond the sea, brought them and cast them into the camp …"
And that’s how the tribes of Israel got so many quails they can’t eat or smoke or dry them all, and the rotting quails made them sick, and people died. So the moral of the story is don’t complain to God about His catering… But anyway…
Now you can see that, in the New Testament, the story of the unauthorized men casting out demons is exactly what this whole Eldad and Medad story was foreshadowing. John was pretty much handing Jesus a straight line. (Afterward, John probably went DOH!
In the New Testament, there’s not such a twist of sarcasm, either. Jesus has come into the world to save and give the Spirit to everyone who will accept salvation.
The point of this story is also that God doesn’t always wait for us to get brave enough to show up at His tabernacle, or for Moses to send somebody to fetch us out of our tents. Sometimes He comes and makes us do things.

Moreover, the exorcist guys were in fact doing a good thing, whether or not they fully understood what they were doing or were authorized to do it. Don’t stop people from doing good; it’s hard to get people to start it at all…
So later, when the Apostles came upon small groups of people who were trying to follow Christ but hadn’t yet been baptized or knowing what to do, it was not their job to get mad at them. It was God who had made them believe. But by the same token, it definitely was not their job to leave them unbaptized and untaught, doing whatever seemed right to them. You don’t ignore or complain about the bounty the Lord provides. It was the Apostles’ job to teach them and regularize everything that was going on. Without any murmuring about God’s catering.
