It was written to take place between season six and seven of DS9 (if you look for it, you can see them try to hide a trim when Picard first sees Worf and they have to move out of their dialog early because Picard immediately congratulates him on his marriage as-shot). MA puts it where it does because there's a string of three episodes where Worf isn't around, but there's not really any one perfect place to drop the movie.
Does 31 take orders from anyone? Can the Starfleet CinC give them an order? Can the Federation President direct their actions? Putting aside DSC and STID for now, in DS9, Section 31 seemed to be pretty much independent. They claimed to be acting with some kind of civil authority, but how could they be? As for Admiral Ross working with them and Starfleet Command covering for them, I'm sure, say, the mafia has had influence over military and government figures, and could coerce people into helping their schemes or discouraging investigations, but that doesn't mean that the distinction between the mob the U.S. military is "only on paper" and exists to give America plausible deniability about the activities of organized crime.
In DS9, 31 was depicted as a gang of ex-Starfleet people. Well-connected and well-supplied, but a gang nevertheless, independent of the larger social order.
Time to dig up exact dialogue. To clear this up one way or another in general.
The Deep Space Nine Transcripts - Inquisition (chakoteya.net)
BASHIR: So, why don't you tell me who you are? Who you work for?
SLOAN: I would think it's obvious. The same people you work for. The Federation. Starfleet.
BASHIR: You don't expect me to believe you're with Internal Affairs, do you?
SLOAN: No, of course not. Internal Affairs is a competent department, but limited.
BASHIR: So which department are you with?
SLOAN: Let's just say I belong to another branch of Starfleet Intelligence. Our official designation is Section thirty one.
BASHIR: Never heard of it.
SLOAN: We keep a low profile. Works out better that way for all concerned.
BASHIR: And what does Section thirty one do, apart from kidnapping Starfleet officers?
SLOAN: We search out and identify potential dangers to the Federation.
BASHIR: And once identified?
SLOAN: We deal with them.
BASHIR: How?
SLOAN: Quietly.
BASHIR: So if I had been a Dominion agent, what would have happened to me?
SLOAN: We wouldn't be standing here having this conversation.
BASHIR: And Starfleet sanctions what you're doing?
SLOAN: We don't submit reports or ask for approval for specific operations, if that's what you mean. We're an autonomous department.
BASHIR: Authorised by whom?
SLOAN: Section thirty one was part of the original Starfleet charter.
BASHIR: But that was two hundred years ago. Are you telling me you've been working on your own ever since? Without specific orders? Accountable to nobody but yourselves?
SLOAN: You make it sound so ominous.
BASHIR: Isn't it? Because if what you say to me is true, you function as judge, jury and executioner, and I think that's too much power for anyone.
SLOAN: I admit it takes exceptional people to do what we do. People who can sublimate their own ambitions to the best interests of the Federation. People like you.
BASHIR: Me?
SLOAN: You have all the qualifications to be a very useful member of Section thirty one.
BASHIR: A few minutes ago, you were calling me a traitor and now you want to recruit me?
SLOAN: Well, you're intelligent, you're resourceful, you've always been fascinated by covert operations. Why else would you spend so much time in Quark's holosuites playing spy?
BASHIR: You're serious.
SLOAN: We're on the same team. We believe in the same principles that every other Federation citizen holds dear.
BASHIR: Yet you violate those principles as a matter of course.
SLOAN: In order to protect them.
BASHIR: No, I'm sorry, but the ends don't always justify the means.
SLOAN: Really. How many lives do you suppose you've saved in your medical career?
BASHIR: What has that got to do with anything?
SLOAN: Hundreds? Thousands? Do you suppose that those people give a damn that you lied to get into Starfleet Medical? I doubt it. We deal with threats to the Federation that jeopardise its very survival. If you knew how many lives we've saved, I think you'd agree that the ends do justify the means. I'm not afraid of bending the rules every once in a while if the situation warrants it, and I don't think you are either.
BASHIR: You've got the wrong man, Sloan.
SLOAN: I don't think so. In time, you'll come to agree with me.
BASHIR: Don't hold your breath.
SLOAN: All I ask is that when you get back to Deep Space Nine, you consider what I've said.
BASHIR: What if I decide to expose you?
SLOAN: Let's just say I'm not going to lose any sleep over it.