Others have addressed the fact that you are violating Kerckhoffs' Principle. I'd like to suggest a way to recast your proposal that doesn't do so.
Making your function be part of the key
If we treat your "function that only you know" as part of the "key" then it is not a violation of Kerckhoffs' Principle. That is, we take your "key" to have two parts. The input passphrase, p, and the secret function, f.
Is your function deducible from its output?
Are you going to memorize both p and f? Probably. Are you going to use a unique p and f for each service that you uses? Probably not.
That is, I expect that you would be tempted to only change p for different cases while reusing the same f. This can be made safe, but what you describe with your example is not. That is because if an attacker gets a hold of a couple of your derived passwords, say f("correcthorse") and f("batterystaple"), they will be able to figure out what f is.
Fix by making your function a pseudo-random function
So if you want to do this, you will need an f that isn't not deducible from the attacker has n of your derived password, f(p1) ... f(pn). There are cryptographic functions that will do this for you. HMAC is what comes immediately to mind.
Let f(p) = HMAC("some constant secret only you know", p)
This way, an attacker who got old of f(p) would have a difficult time trying to discover the constant secret, particularly if they didn't know p.
Encoding issues
Note that the output of f(p) is not going to be ASCII text. So you would need to transform it into something usable as a password where you need it. It is hard to do this generally. For example if you used base64 encoding, you would need to make sure that the place you are using the generated password will accept all of the symbols that can appear in base64. Likewise, if you use a hex representation, you may not get all of the "symbols" that some services may require for a password.
It's these encoding issues why this system won't work as a general scheme. It can be used and then manually tinkered with on a case-by-case basis, but that means that you can only use it for a couple of cases.