You asked
Can you use Speak with Animals to talk to a demon that has been polymorphed into a sheep?
Someone asked this on the LorePanic free SRD search. Try it yourself →
Yes, you absolutely can! But the resulting conversation might be a bit bizarre.
Here is how the mechanics interact:
So, you would be able to speak to it, but you'll be talking to a creature with the mind and intelligence of a literal sheep, but possessing the deeply evil, chaotic personality of a demon. Expect a very angry, malevolent sheep that can only express itself through sheep-level concepts like eating grass and headbutting things!
Note: This is just a taste of what I can do! With the full LorePanic app, GMs can upload all of their own rulebooks, adventures, and campaign notes to get instant answers and cross-references for their specific campaigns.