But if the ship is sentient it raises all sorts of issues. For instance what if Burnham tries to fly the ship into a dangerous situation and Zora dos a Peanut Hamster on them. It could even go full Hal and space them.
Also what if Burnham thinks the best course of action is to "blow up the damn ship" does she now have any moral right to still have destruct codes for a sentient life.
As the real Bruce Maddox knows full well sentient machines are not property of Starfleet.
The ship needs to be taken off active duty.
Small correction: its 'Peanut Hamper'... but I don't think Zora would do that. Peanut Hamper abandoing Cerritos was sort of a comic gag... and I doubt that in the live action it would have happened that way (especially because one of the first sentient exocomps DID sacrifice themselves to save the other two - although they also demonstrated that they CAN defy orders like any other organic being).
Lower Decks is canon, but even the creators of the show said certain bits are 'exaggerated' by intent for the laughs and shouldn't be taken too seriously.
What we could imagine is that Peanut Hamper decided not to sacrifice itself, which the crew accepted and then Rutherford went and volunteered. .. or he refused to let Peanut Hamper go in the first place.
Zora knows what Starfleet and UFP stand for (which would include self-sacrifice if the need arose). As such, I think she became a willing participant (or basically, that much was a given when Zora effectively transferred herself into the DOT's which went and gotten themselves needlessly blown up - seriously, where are the personal shields?)... and there's the fact the Sphere Data transferred itself onto Discovery for self-preservation in the first place technically by asserting itself and refusing to let Discovery go before it could do that (which in the end the crew allowed once they realized what was happening).
So, for all intents and purposes, Zora is pretty much a SF crewmember now... and she has to follow the captain's lead... but its also possible the situation you mentioned would arise and it will create a bit of a problem down the line.
Its also possible the Sphere data made copies of itself and uploaded it to UFP databanks at HQ in the 32nd century (with SF's permission of course - so in case a dangerous situation arose... the data would persevere and update itself periodically as Zora grows and learns).
But I agree that sentient machines are NOT property of SF... though the situation is a bit different due to Disco's unique spore drive and SF's continued inability to replicate it (which is really stretching the limits of credibility)... plus, Discovery was crucial in figuring out the Burn, so I think during those 5 months, they all reached a sort of an agreement to continue functioning as thye are.