Without a lead-up tournament under his belt after the birth of his second child, the three-time defeated Open finalist was forced to dig deep to win 6-2 4-6 3-6 6-1 6-2 over Thai wildcard Samrej in three hours and eight minutes.
The world No.418, just the third Thai to make a grand slam singles main draw in the open era, pinched the second set off Medvedev after the Russian raced through the first in 30 minutes.
The oft-temperamental hard-court specialist fell into a bigger hole, dropping serve to fall 3-5 down in the third.
He took his mounting frustration out on a net camera, smashing it and his racquet to bits to earn a warning from the chair umpire as Samrej brought up two set points
Medvedev smashed his racket on a net camera and earned a warning from the chair umpire. (Joel Carrett/AAP PHOTOS)
Down two sets to one, Medvedev leaned on his five-set Open record, having previously won five of his eight contests that went the distance, to force a decider and break open the match.
"I know that I play better when I play more tennis," he joked to the Rod Laver Arena crowd.
"So I was like why play one hour and 30 (minutes) I need minimum three hours to feel my shots better, to have a good sensation.
"In the second and third set I couldn't touch the ball."
Samrej earned his Open spot with four wins in the Asia/Pacific wildcard playoff in November and did not look overawed by the calibre of his opponent, who had never lost to a lower-ranked player.
Medvedev said he watched the 23-year-old's matches in preparation and did not witness the level he produced on Tuesday.
"I was surprised," the Russian said.
"If he plays like this every match, his life can be good. Money, girls, casino, if he plays like this every match."
Medvedev, who next faces 19-year-old American qualifier Learner Tien after he also won a five-set battle over Argentine Camilo Ugo Carabelli, failed to win a single title on tour last year.
His attempts to add to his sole grand slam - the 2021 US Open title - were compromised by the ascension of Carlos Alcaraz and Jannik Sinner.
It was groundhog day for Medvedev in the Open final last year when Italian superstar Jannik Sinner clawed back from two sets down to hoist his maiden major championship trophy.
He lost in painfully similar circumstances to now-retired legend Rafael Nadal in the 2022 decider after his straights-sets defeat at the hands of Novak Djokovic a year earlier.