OP I am so sorry, this is completely unacceptable.
I unfortunately had a similar (but not exclusively food focused) issue in hospital on a section in October.
I was sectioned in October in Scotland. I had been begging for MH services and a medication review for 18months. A consultant who I had never met, came into my house while I was sleeping (with 4 other people, did not wait for police, completely illegal). They said I was a danger to myself with no evidence of this other than regular proactive requests for access to Social Services (I am autistic) and a medication review (I had been on an off license anti-psychotic for depression and anxiety for TWO years without review and side effects).
I am incredibly reclusive and I suffer from ARFID as well as various serious sensory issues. They refused to call me an advocate (it was day 6 they finally did). They refused to give me my section paperwork (my legal right and something I requested immediately - It was posted to me WEEKS later). I wasn't allowed headphones to regulate away from noise. I was in a ward with several very volatile men and a police presence (I am a young woman with a horrific history of traumatic abuse). I could not leave my room. I didn't sleep for 5 days until they sedated me to sleep. At one point I begged a nurse to read over my health passport, and read over some of the guidance from NICE and Autism Charities on best practice with Autistic inpatients. They point blank refused - my visitor at the time thankfully witnessed this.
I didn't see a doctor for review for 8 days. In those 8 days I did not eat (no 'safe' foods available, as a child and in my teens I was on a feeding tube as my eating is so restrictive, so this was not a small issue). On day 8 the consultant and the MDT admitted they had no grounds to section me and I was free to leave.
8 days of hell, no sleep and no food. I was admitted while proactively seeking services, and discharged with a truly deep fear of hospitals and doctors. I am scared of my house (they entered illegally), and terrified to go back to MH services at all despite clearly needing them badly. I have also gone from the best place I have ever been with food, to the worst - and my diet has shrunk to 3 items.
I have been home for 2 1/2 months-ish, and in that time I have had no medication review, no appointment, no follow up, no letter (other than the section paperwork) and no phone calls. No contact made at all. I have directly requested to be referred privately (I have money saved for this), but the NHS refuse despite a private hospital being willing to take over my treatment (the currently non-existent stuff!).
I was baselessly detained, frightened more than I have ever been and treated like shit.
I am stunned and horrified at the posters saying a gluten free diet is a fad, it is a medical necessity and you are in hospital. I am also horrified at those choosing to use this platform to trivialise vegetarianism and the likes, these are protected beliefs and unless these posters think religious diets should not be accommodated - they are hypocrites. (But both are protected by law in the same manner).
If you happen to be in Scotland, give me a message. I am really sorry you are in this position and I would advise you contact PALS or PASS as relevant to your location. Ask for an independent mental health advocate if you think this would help you. They wont contact until Monday now but you are absolutely entitled to one asap who will advocate ONLY for you.
You can appeal the section if you think it is unwarranted, you will get a solicitor for free for this but you may need to find one yourself as the hospital will likely be reluctant to put you in touch - If you do this you can expect an appointment asap along with an independent doctors assessment within a week, and a Tribunal very quickly.
Assuming this is where you need to be, if you ask for paperwork for a 'named person', you can list a person of your choice here to advocate for your care (or release) while sectioned. They have a different role than next of kin but can be the same person. This may give a family member of yours a better starting point to come in and insist they feed you. Food is not a luxury.
Jesus Christ it's like dystopia, and half of the posters here seem to think it's FINE!!!! The NHS is in a crisis like never before and minimising the dire state of it, and the dire care received is as batshit as I have heard in ages.
I hope you can get some sleep tonight and see your family tomorrow. You CAN order food into the ward and you can have extra brought and ask for it to be put in a fridge for you to have at mealtimes.