I have seen intermittent delays of a 5-10 second nature, mainly with controlled substances. It seems to be getting more frequent/longer over time (have been using AC since 2018 when Soapware folded) not sure if that's related to the size of our database?

40 seconds is certainly unacceptable. Time for a support call I think.