The way I interpreted it is there was more than one night that Fonny and his friend hang out. That first night isn't THE night. For two reasons. One, there a moment where she's serving dinner and he jokes about her cooking, which implied it wasn't the first visit because they hadn't met previously. Second, they don't have the loft yet. It made sense to me that they started hanging out and the arrest happens some time later. But dang every second of that first night hang I was holding my breath. Oof.
How the cop knew where to find them kept tugging at me. Did he follow Fonny? Look him up? He was obviously motivated to go after Fonny, so I'd buy that he dug around and found out his name/address for use when it suited him.
One thing I was curious about, though: They never even hint that the cop framed him. Nothing like that is ever spoken, only shown in a single scene. Which I think is an interesting narrative choice by Baldwin -- he avoids giving the arrest/incarceration a singular cause. All of this is systemic. This also maps to the non-explanation of how the cop finds him. It doesn't matter how or why, it just happens because the system is rigged.
OTOH, it did make me wonder if the book, which I haven't read, absolutely confirms it was indeed the same cop. I assume it does, but without any dialogue it felt like it could be implied but not stated outright.