Unfortunately that mean teacher was correct in her grammar, as "can I" refers to the inquiring individual being physically able to walk to the bathroom, whereas "may I" is asking another for permission.
The "shall/will" distinction relates to first person, second person, third person, tense of person: i.e. "I/we shall ..." (first person) versus "you/you will" (second person) and "he/she,they will" (third person). I had to take four years of Latin in high school to learn that latter rule of English grammar. Most English speaking Americans just either don't know or just ignore that rule and use interchangeably "shall" and "will" for all three tenses both singular and plural