Man tricks court into giving bail, gets jail