try

/ac "Second Wind" <me>
/wait 1
/item "Mega_potion" <me>

ability and item usages have a cast/channel time, without the /wait 1, the macro tries to immediately use the second ability which fails because you are currently in the middle of the animation of the first ability. Adding /wait 1 gives the system enough time to cast the ability animation of the first /ac while initiating the next.