BEIJING — Months of bureaucratic surrealism culminated last week with Ye Jinghuan, 63, a retired manager at a major Chinese company, sprawled on the floor in a Beijing court building and served with a 15-day detention order, together with four of her friends.

The episode at a branch of the Xicheng District Court has deepened a sense among Ms. Ye’s friends and some lawyers that China’s police and justice systems are seriously broken, despite the promises of President Xi Jinping and other officials to “rule the country by law.”

It began with a small and easily avoidable injustice.

“She went to the police early last year to ask for a document proving that her elder sister was her sister,” said Zheng Wei, 61, a friend who accompanied Ms. Ye last week.

The “document proving a relative’s connection” is a common feature in legal or administrative cases. It is issued by the police in the place where a person’s hukou, or residence permit, is based.