Rambam Hilchot Avodah Zarah 3:1
עבודות הרבה קבעו עובדי כוכבים לכל צלם וצלם ולכל צורה וצורה ועבודת זה אינה כעבודת זה כגון פעור שעבודתו שפוער אדם עצמו לו ומרקוליס שעבודתו שיזרוק לו אבנים או יסקל מלפניו אבנים והרבה עבודות כגון אלו תקנו לשאר צלמים, לפיכך הפוער עצמו למרקוליס או שזרק אבן לפעור פטור עד שיעבוד אותו דרך עבודתו שנאמר איכה יעבדו הגוים האלה את אלהיהם ואעשה כן גם אני, ומפני זה הענין צריכין בית דין לידע דרכי העבודות שאין סוקלין עובד כוכבים עד שידעו שזו היא דרך עבודתו
The gentiles established various different services for each particular idol and image. These services do not [necessarily] resemble each other. For example, Pe'or is served by defecating before it. Marculis is served by throwing stones at it or clearing stones away from it. Similarly, other services were instituted for other idols.
One who defecates before Marculis or throws a stone at Pe'or is free of liability until he serves it according to the accepted modes of service, as [implied by Deuteronomy 12:30]: "[Lest one inquire about their gods, saying,] 'How did these nations serve their gods? I will do the same.'"
For this reason, a court must know the types of worship [practiced by gentiles], because an idolater is stoned to death only when we know that [he has worshiped a false god] in the mode in which it is traditionally worshiped.
(Touger translation)
Thus a court could mistakenly rule that a certain form of worship is not the correct mode of worship for a particular idol.