Am I forsaking the assembly
if I leave a church in error?

No, because Paul’s warning about not forsaking the assembly was for churches holding to apostolic doctrine and truth (Heb 10:23-25). It is usually better to stay at home and do the best you can rather than participate in doctrine, worship, or practice that is contrary to the Bible. Paul taught that believers should withdraw from Christians in disorder (Rom 16:17-18; II Thess 3:6). If you do visit churches in your search to find a better one, you should never take communion, because it means you are in common union with that church.