The canons
Let a bishop, presbyter, or deacon, who has only prayed with heretics, be excommunicated: but if he has permitted them to perform any clerical office, let him be deposed.
If any clergyman or layman enters a Jewish synagogue or a heretical assembly to pray, let him be deposed and excommunicated.
(The 65th Apostolic Canon)
No one shall join in prayers with heretics or schismatics.
(The 33rd Canon of the Council of Laodicea)
A video with details on this question
https://rutube.ru/video/86f09aac3920a287aaf041a3ffe019b2/?t=138&r=plwd
The question of prayer before a meal when visiting heretics
A question from an Orthodox Christian (formerly a Protestant):
Brothers, tell me what to do: for example, I often have to visit my former Protestant friends and sit down with them at a meal, before which they pray and sometimes ask me to pray too — am I sinning by this?
The answer of the clergyman, priest Evgeny Veselov:
You should say beforehand that it is not possible to pray together, but that out of respect you are ready simply to stand during their prayer. At the end, do not say “amen.”
If convenient, after their prayer read the “Our Father” yourself. Or at least simply say “Lord, bless” and cross yourself. You can also make the sign of the cross over the food, if the hosts do not object.
(October 12, 2024)