Hello there,
Yes the information you received from the US immigration officer is correct. It is best to wait until you get the actual green card in your hand before traveling internationally. You can also get a stamp in your passport (assuming your passports are not expired and valid for at least 6 months or more preferably) that states I-551 proof of green card status, but now with travel issues happening everywhere even for US citizens, I myself would wait for the actual green card to come in the mail unless it is an emergency.
You will most likely be allowed to re-enter the US (assuming no criminal issues) with the stamp in your passports, but you may also get a lot of hassle upon re-entry.
I forgot to mention that in order to get your passports stamped, you must first make an online infopass appointment.
USCIS does not let you enter their building without an appointment. Bring all relevant documents with you, especially your passports and 2 passport-style pictures each just in case the officer makes an official I-94 card for you instead of just stamping your passport with the I-551 stamp. Bring all other documents with you that you received from USCIS as well as birth certificates if available for ID purposes only (just in case you get a picky or lazy officer who does not want to do the stamping and needs an excuse not to). Follow all other instructions as indicated by the immigration officer you spoke with, as I have not included the full instructions.
Also it is completey normal practice that the Immigration Officer takes the I-94 during the green card interview.

