In a sense yes, but the TX can be analysed and blocked. E.g. core does not relay dust TX. An encrypted TX can not be checked. It could also be invalid entirely which would make the block its in invalid as well.
If an invalid TX gets confirmed then it should remain invalid without making the block invalid.
IMO miners should only care about the TX fee and confirm anything that is signed with a private key that holds unspent inputs. But there are other ways to implement such encryption. For example, the encrypted TX might require a reasonable amount of coins to be locked until the TX gets confirmed and the encryption key broadcast. If the TX turns out to be invalid then the locked funds would remain locked as a penalty for making an invalid TX.