The Messenger of Allah ﷺ said, "Whoever is invited and does not respond has disobeyed Allah and His Messenger, and whoever enters without an invitation enters as a thief and leaves as a raider."
حدثنا مسدد حدثنا درست بن زياد عن أبان بن طارق عن نافع قال
قال رسول الله ﷺ من دعي فلم يجب فقد عصى الله ورسوله ومن دخل على غير دعوة دخل سارقا وخرج مغيرا
[Its isnad is daif] Bayhaqi transmitted it: 7/68, from the hadith of Abu Dawud, through him.Darust bin Ziyad is daif, and his teacher is unknown, as Abu Dawud said.