This is elementary grammar, but i see how you'd get confused if you're new.
君は - "you" marked with the wa particle, aka the topic marker (or subject marker if it was marked with ga but since there's no ga the subject can only be "kimi"), means whatever the predicate of the sentence is -- "you" is doing it. Hence for simplicity i'd rather call it the "doer of the sentence".
何かに - "something" marked by ni, in this instance ni establishes the the actor that is causing the verb (not doing the verb) "to bite", what this translates to is "bite by something" as compared to "something does bite" if we had ga instead.
足を - the "foot" is the direct noun that is affected by the verb, you should know this, this is literally "to bite the foot"; ashi ga ~ (foot got-bitten) wouldn't quite fly, see annotation below, in short: no, direct object cannot be the subject.
かじられた - our predicate, the verb in the passive form, the doer of this verb is our established "you", only wa or ga can mark the doer, this translates directly to "got bitten", plain past ~かじった would've made it "you bit", which wouldn't make sense again because it's not you biting your foot it's "something".
The rest are ending particles, but I'll skip them.
So what we have is "you, by something, foot got-bitten" or more naturally: "you got your foot bit by something".
「君は何かが足をかじったんだね」- i wouldn't say this is ungrammatical but the passive construction is more suitable for this kind of scenario, because it centers on the "you", and your altered sentence makes the subject "something", instead of "you". And the connotation here probably is "you idiot were so careless dipping feet in the pond and got yourself bit by something in there", focusing on that "something" would make it neutral or shift the "blame" on it, but since i don't know the context it's speculation.
「君は何かに足がかじられたんだね」- not very natural wording, 足がかじられた alone would work, but not when we need to establish actual subject (more important than foot, like foot's owner). Also putting the ni-marked cause before the subject is very wrong. And there's also the fact that "foot" is inanimate object, and more often than note those are marked by wo.
Compare other passive sentence to get the idea:
「私が鞄を盗まれた」「私が犬にお弁当を食べられた」, as you see these fall in line with our sentence pretty well.
You want to treat object as the subject because it's usually how you put things in English, but it's important to go along with the expressions strategies your target language is using rather than converting those from your native language to it. So it is generally recommended to think of Japanese passive as "one got (something or oneself) acted upon(got bit/got my foot bit)" English structure because it sets subject as the pronoun(or whatever thing or person performing the verb) marked doer, exactly like Japanese does. Translating it as "My foot has been bitten by" just makes you confused like now.