Is this illegal? Charity has passed a new bylaw that relates to religion that wasn’t present before May 2005

Can an organisation that is also a registered charity that has one central governing body with different chapters in most major UK cities pass a bylaw that prevents its chapter committee members from running for the central committee if they have church membership?

This bylaw was passed in 2024 so has not been part of the existing rules/ bylaws before May 2005.

The way the organisation works is: There is a central committee and there are individual chapters in most major UK cities/ regions. Membership is via belonging to an ethnic group with implied membership to Christianity. The central committee has elections every 2-3 years for its positions as does the individual chapters for their committee positions. The central committee has certain bylaws that apply to all chapters by the individual chapters can have additional bylaws that only apply to their chapter. The organisation is a registered charity and has recently passed a bylaw preventing people with church membership from standing as candidate for the central committee elections. As mentioned above, this bylaw was passed in 2024 and was not in place before May 2005.

Is this illegal? Would the organisation risk losing its charity status? The charity js registered in England.

TIA