You can work around this by firing the macro directly from the macro editor, without putting it on a bar.
Once your retainer is summoned and inventory opened, type

/macros

Then right click your macro and "Execute".