When you make reference to the ayaat about ruling by other than what Allah has revealed, you should first consider that the necessary condition for those ayaat to be relevant is the EXISTENCE OF A REVEALED RULING.on any given matter. And that means an actual legislative ruling, a Hukm, not just an admonition or a warning of Punishment in the Akhirah.
The illegal things are all sinful, but not all sinful things are illegal. Adherence to the overwhelming majority of religious obligations and prohibitions is a matter left to the individual conscience, not to state law enforcement .
Bear this in mind.