Welcome to the Quickbooks Community. Thank you for detailing your concerns about being unable to delete transactions as it requires a passcode. I have pieces of information that could help clear some confusion.
In QuickBooks Online, when you're ready to close out the year, close your books to prevent unwanted changes before filing your taxes. It locks your books so no one can edit your accounting data before the closing date. It could be the transaction you are trying to delete is within the date range of a closed book. You'll want to double-check as, if it turns out that way, you won't be able to delete the transaction. If you don't know the passcode, I suggest contacting the primary admin or the person who closed the books at that time.
For detailed information, refer to this article: Close your books in QuickBooks Online.
I'm adding these articles you can use in the future:
If you have more questions about managing your transactions in QuickBooks Online, post them here in the forum. I'll be sure to answer them in any way possible. Have a good one!