Like even what the two Curl commands would be in the small example there would be helpful.
It might be, for example, that some 3rd party app doesn't retry database connections. So, you have to start the database server first, and wait until it's accepting connections before you start the 3rd party app.
Just a guess though. You're right...it should have been less vague.