It depends. Yeah, it’s possible that could be a bit of a spoiler. But it depends on the way it’s positioned. If the prince is an ally of the PCs who they’d likely trust or believe, then it’s kind of baked in.
Also, how severe of a spoiler is it? It’d be like knowing you’re gonna wind up fighting a vampire if your DM says “I’m gonna run Curse of Strahd.”
Then of course there’s also no reason that you have to make it a frame job. Maybe the prince is simply the most obvious suspect, and maybe he turns out to be guilty. Seems a little anticlimactic to run it that way, but I don’t think there’s any reason it must be so.
Here's the positioning:
There were 6 PCs with mixed classes about 7-9th level with about the same number of henchmen a couple of levels lower. One of the PCs was trying to ingratiate himself with the royal family and working to court a younger daughter, The prince was partying cad. The family knew he frequented "bad" areas in town and was involved in shady pleasure activities.
There had been some foreshadowing of the illusionist at court. The group had traveled by ship with her previously as she came to meet her sister (the prince's betrothed) and there was some indication she was more than she appeared.
The rulers turned to the PCs to get an answer before the justice system got involved. They wanted to know if their son and heir was guilty of such a heinous act. They needed a fast and discreet investigation before public accusations spread.
I figured the party would in fact try to exonerate the prince both because he's the freaking crown prince and because that route provides stronger gratitude with the royal family not to mention doing a thorough investigation would be good. Certainly, the PCs had more then enough tools at their disposal to effect such an outcome. The player taking lead on the investigation quickly assumed the prince's guilt and did just enough investigation to surface the framing clues and no more. All evidence that pointed to exoneration was ignored or dismissed, The party reported their investigation and laid out a damning case against the prince to the ruling couple.