Three parties, one agreement
A landlord's agent arranges cleaning for the parts of a property the landlord is responsible for. The head lessee holds the lease and may arrange cleaning for their own premises. A subtenant occupies part of that space under an arrangement with the head lessee and has no relationship with the landlord at all. Each of them may be on site and each may have a view.
For a contractor, the question is simply which of them holds the agreement being performed. That party's instructions are actionable and nobody else's are. It sounds obvious and it is routinely muddled in practice, because the person who is present and asking is rarely the person who signed anything, and refusing on the spot feels unhelpful. Refusing on the spot feels unhelpful, which is exactly why it happens so rarely.
