The information to apply for a variation of travel conditions on your Resident Visa can be found
here.
According to the INZ fees and decision time finder, the time taken to get either a variation of travel conditions, or a Permanent Resident Visa, is currently being quoted at 33 days. Given this timeframe, you should not expect to receive your passport back before you travel on June 4th if you apply for a Permanent Resident Visa on or after May 2nd (by my calculation, your passport will likely be returned to you the day after you depart!). However, if you apply for a variation of travel conditions with a degree of urgency (read: next business day), you should be granted this (if deemed eligible for a one year variation) and should receive your passport back sufficiently in advance of your departure date. With a one year variation of travel conditions granted, you would then be able to leave New Zealand and return as a resident for your planned trip, and can then safely defer your Permanent Resident Visa application to whenever you return.