Run the below query against the database to check the "is_auto_close_on" setting.
Select * from sys.databases with (nolock)'
If the "state" and "is_auto_close_on" setting for the particular database is not set to "0", then see attached screen shot to set “Auto Close” to “False”.
Reference: https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-databases-transact-sql?view=sql-server-ver15