He is sinful for his negligence yet the prayer is okay

It was the day of jumu’ah and basically a person was walking in town not planning (couldnt be bothrted) to pray jumu’ah in the masjid but in the town library found a musalaa of people doing jumuah then i joined them was this okay?

Prayer |