Depending on when the house was built or when the wiring was last updated if it's as old as mine, bathrooms may or may not be on dedicated circuits. Bathrooms have been required to be on a dedicated circuit (more than one bathroom may share that circuit) for 30 years or so. Bedrooms are not on dedicated circuits and the circuit may be shared by more than one bedroom.

If the lamp only works when the cord ins in one position, like my earbuds, then it's faulty and should be repaired/replaced.

If the GFCI was tripped that indicates that a piece of equipment was plugged into the GFCI/AFCI (again depending on age of the house) or a protected outlet downstream, has a current imbalance of greater that 6 milliamps (ma), which is a regular trip point in a GFCI designed to protect persons as opposed to GFCI's designed to protect equipment which have a trip point of 25ma. What this means is that there is a differential between outgoing current and returning current that exceeds that setpoint that is great enough to give you a good jolt, so it trips.