I noticed that polytheist creatures sometimes can still get stuck praying / meditating to only one of their deities (even though their praying need to that deity is completely fullfilled and their other deities really need praying to they will still have the pink/purple worship or meditate job for their alraedy appeased deity).
This has been a thing for years, and back in the days I posted a workaround to fix the behaviour (sorry too lazy to battle the Lovecraftian horror that is this forum's search engine to find that post), but that workaround involves so much micro and hassle that it is too tedious (in short, you need dedicated temples to all involved deities, and you need to micro stuck dwarves with squad assignment, stationing /cancelling orders, and locking doors at the right moment so they bump into a locked door after pathing is set).
Suggested easy temporary fix for Toady and Putnam: until the root cause is fixed, disallow creatures from worshipping more than one deity. This will 100% resolve the issue gameplay-wise for now.
As for the root cause: Hey, I am no coder, I am at best a novice Logician, but what I suspect is what happens, is that a polytheist dwarf with praying needs for multiple dieties will make a check after the praying need for one deity is fullfilled.
This check will tell the dwarf that more praying needs to be done (to another deity), but the flag / cache that dictates to which deity the dwarf will pray is not reset/updated, so the dwarf will keep praying to the already satisfied deity.
The type of temple (all deities / single deity) does not matter for this behaviour if the check to see if the dwarf is in an appropriate temple for his current pray/meditate job is made after the job assignment (dwarves will get stuck in all deity temples as well as in dedicated temples).