Is it an offence to stand on a road side and talk to friends

This evening me and my mates were riding 2 motorcycles on a newly opened bypass road in our town and as a common friend passed by us in his car we decided to stop the vehicles and talk for sometime. We parked our vehicles after a traffic light signal about 50 metres ahead of it. There was more than enough space to park and we did carefully park our vehicles about a foot outside the white line and we started talking. As the road was opened only yesterday, we saw a lot of people violating traffic lights because of unawareness as its our first road in town with traffic lights. The appointed police man was doing nothing about it and it was an amusing sight to watch which made us stand there for almost an hour. That time our Circle inspector came that way and asked why we were standing there. He verbally abused us and took away all our vehicle's registration certificates and driving licences without giving a clear reason when asked. We were not blocking the road, not smoking, not drunk or on drugs. We were literally standing there and talking. He asked us to come and collect them from his office. After about 15 minutes we went to his office to collect the documents. He neither gave them back nor gave a reason for his actions. He said he wont give them to us so easily and he want us to run behind him atleast two days and then he will think about giving them back or if we insist on getting them now we should pay 1000rs each to him. We are confused what to do. Can you please advise?