There was an entire TNG episode (Season 6, Episode 12) whose plot centered around this:
spoiler
Moriarty was reactivated by mistake, and took the ship hostage, demanding to be able to leave the holodeck.
Geordi and Data spent half the episode experimenting with beaming (inanimate) holographic objects off the holodeck, to no avail. With that said:
spoiler
Their transporter turned out to be a holographic fake (and so was Geordi), so who knows if the results were valid.
I quit my last job because management wanted us back into the office at first one, then two, then three days a week - all so that we had to commute into an office pointlessly and then either spend the entire day on Teams calls, or just sit at desks writing exactly the same code that we would have at home.
When I accepted my new role, I made very sure that my contract of employment was explicitly set up for full time remote work only.
I wish the best of luck to anyone attempting the same switch at the moment, the job market in general (and especially in tech) is in a crazy situation at the moment.