This study explores the legal issues arising from housing and settlements, where individuals may assume defendant status when occupying a house without ownership, a status valid only with the owner's approval. The enactment of Law Number 1 of 2011, which revokes Law Number 4 of 1992, prompts judges to ponder its implications, especially in relation to Article 1 paragraph (2) of Law Number 1 of 1946 concerning the Indonesian Criminal Code (KUHP). The judge's decision, linked to the unlawfulness of the case, raises significant concerns. This paper seeks to underscore the inaccuracies in the judge’s interpretation of Criminal Code Article 1 paragraph (2) and the disregard for material law in the decision-making process. The research findings unveil a disparity in perspectives between Law Number 4 of 1992 and Law Number 1 of 2011 concerning case handling, leading to the conclusion that the case fails to satisfy the elements of Criminal Code Article 1 paragraph (2). The judge's misinterpretation is rooted in prioritizing the principle of legality (Article 1 paragraph 1) while overlooking the violation of material law. Importantly, this research contributes a nuanced understanding of the legal landscape, shedding light on the implications of housing laws and their intersection with criminal statutes.