I take that as people who are trying to work their way into Heaven, though their own good works. Note not one of them claims to have had faith. Instead they all say “Didn’t I...”
Understood. In verses 15-20 Christ spent a lot of time condemning false prophets. That’s why it appears to me that false prophets are still His primary focus in verses 21-23, specifically mentioning them yet again. But you’re right that He overall condemns a “works-based” profession of faith.
Interestingly, too, from verse 21, from a Doctrines of Grace perspective “poieo” (doeth) can also be translated “be,” and “thelema” (will) can also be translated “choice.” That would put a whole other complexion on the passage.