EspMQTTClient inside a class
For the fix, just add the reference capture and it should compile fine:

   // Execute delayed instructions
  client.executeDelayed(5 * 1000, [&amp;]() {   // [&amp;] instead []
    client.publish("mytopic/test", "This is a message sent 5 seconds later");
  });


I could not test, but you will have to apply to other functions as well.

[] Capture nothing 
[&amp;] Capture any referenced variable by reference 
[=] Capture any referenced variable by making a copy