I recently found an open-source class library that declares that it "has the permission to prohibit a certain individual from using it" and I can't stop wondering if I published an open-source project/software under AGPL license then can I make the same declaration? or is it just an invalid statement?
The license must not discriminate against any person or group of persons.
I am not a lawyer, but the terms of the AGPL and the statement mentioned in the question that "The author [sic] has the permission to prohibit a certain individual from using it" seem to contradict each other. Which one takes precedence and which one is invalid is beyond me, unfortunately.
It seems to me there are two ways to interpret what you propose. Either
a) you make the software is available to all under AGPLv3, except John Smith, who may not take a copy under any terms, or
b) you make the software is available to all under AGPLv3, with the additional proviso that John Smith is never allowed to use it.
In the case of (a), anyone who isn't John Smith may take a copy under simple AGPLv3, and then give a copy to John Smith. In the case of (b), anyone who isn't John Smith may take a copy, ignore the additional restriction under AGPLv3 s7, and pass an unencumbered copy on to John Smith. Thus neither interpretation has any practical force, and they can both be ignored.
Possible interpretation (c), that the software is available under some kind of licence which is AGPLv3 with an added durable proscription on use by John Smith, can be ignored, since such a licence can't legally exist (line 2, "everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed").
If I am the sole copyright holder, I can distribute under any license I wish. Now "AGPL with one exception" is not AGPL obviously. I don't know about AGPL, but the GPL license is protected by copyright, and comes with a license that allows you to copy it unchanged, but does NOT AT ALL allow you to make any changes. Assuming AGPL is the same, you have no permission to use the text of the AGPL with modifications, like your one person exception. You are allowed to pay a lawyer to write a new license for you from scratch that would have the exact same meaning as "AGPL with exception".
(To make this clear: A license is a written document, and like any written document has its own copyright, and can come with its own license. The GPL license is NOT GPL licensed for very good reasons, because the creators of the GPL license want to avoid people creating chaos by making slightly modified "GPL" licenses).
Open Source licenses follow the pattern: "You may make copies and modified copies, which you would not be allowed to do without a license due to copyright law, as long as you follow the terms of the license". If you start with AGPL licensed code, modify it, and distribute it with your "AGPL except John Smith" license, you are most likely in violation of the AGPL license and your distribution is copyright infringment. However, if I received that code from you, I do NOT have a license that allows me to give a copy to John Smith, and John Smith isn't allowed to receive it from me.
If I or John Smith are sufficiently annoyed with the situation, we can find and contact a copyright holder of the original AGPL licensed code, and that copyright holder can sue you for copyright infringement. You then have the choice to go back to the original AGPL license (and I can distribute to John Smith), or to stick with your license, pay damages for copyright infringement, and I do still not have a license to distribute to John Smith.
(I am not a lawyer and therefore this is not "legal advice")
If you really received the program under the terms of the AGPL v3, then look at section 7, third-to-last paragraph:
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term.
Although I am not a lawyer, I suspect that if the copyright holder says you don't have permission to copy their software, then you don't have permission to copy their software; however, since they are giving every other member of the public permission to copy their software and delete the restriction, your friend could download the software, remove the restriction which prevents you from being allowed to have it, and then distribute that copy to you.
The owner of the complete source code is not limited to the list of official versions of any license. It is possible to write the license in the way "All terms of the known GPL license apply for everyone except John Smith". Changes are not permitted in the licenses but should be possible to reference them in any context.
However such licenses are not GPL, AGPL, Apache, whatever and would be illegal to name them so. They are just different licenses. They probably cannot be called Open Source either while all other users apart John Smith may not bother too much.
Hence that library you address cannot be under AGPL. It is under own specific license. If they anyway claim it IS, FSF probably would not be happy at all after knowing this. But if they write "mostly similar", this means exactly that much - mostly similar.