In a perfect world, Joe Johnson would have returned from a five-game injury absence last night, scored a bazillion points and led the Nets to a rout.

But rarely are matters perfect in the Nets’ world, especially games in which they get out to a big, early lead and are forced to do things like play the third quarter or finish.

So facing the pitifully shorthanded Bulls, the Nets — and specifically Brook Lopez, who in the final minute turned over the ball, got blocked and missed an open shot to tie at the buzzer — came apart and lost, 92-90, at Barclays Center. One of the few positive elements that emerged from the disheartening mess was the team in part achieving one of the goals interim coach P.J. Carlesimo set beforehand.

Work Johnson back in, get him time.

“We don’t want to lose [the] eight games ... we have left but the No. 1 priority would be for Joe to be healthy and play minutes and us get used to him being on the floor again,” Carlesimo said.

Well, they lost one. But the Nets had Johnson on the floor and were within 74 seconds of him being the hero. Down one, the Nets vaulted to an 88-86 lead with 1:14 left when Johnson nailed a 3-point shot, his third of the fourth quarter.

“I felt pretty good. My wind isn’t where I would like for it to be but I felt pretty good out there,” said Johnson, who shot 4-for-11 and scored 12 points (11 in the second half) in his first game since March 23 after sitting with a sore left heel and sore right quad.