That depends. Ensuring that records are available for audit by giving no notice and insisting on immediate and secure access may be essential in securing evidence if criminal falsification is expected.
People do illegal things like falsify logs, wipe data recorders, fudge FTLs, pass medicals they shouldn’t etc. Not saying the authorities had cause in Heli Holland‘s case; but apparently they thought they did.