The prevailing view of point-of-view in fiction is that, having chosen a particular point of view, the writer ought to stick with it — if not throughout a novel (which may not, depending on the nature of the story, be practical) then at least until a chapter break. If that’s not practical either, the writer is advised to insert an empty line, to alert the reader to the fact that the text is switching to a new POV.
Switching to a new POV without indicating via a line break or chapter break that one is doing so is called “head-hopping.” This is a pejorative term.
The idea that one ought to keep the POV consistent is not bad advice — but it’s not a rule, it’s just a fashion. If you understand what you’re doing, you should feel entirely free to do what you need to do. If an editor complains, just tell the editor to take a flying leap.
My impression is that POV shifts were not considered anathema by talented writers in earlier times. Virginia Woolf is generally considered a fine writer. If you open up her novel Mrs. Dalloway, you’ll find a point-of-view shift in paragraph 4 of chapter 1. The first three paragraphs (and the initial sentence of the fourth) are in Clarissa Dalloway’s POV. Woolf then shifts, for one long sentence in the middle of the paragraph, to the POV of a neighbor, Scrope Purvis, who observes her standing at the kerb. The third and final sentence of the paragraph shifts again. The start and end of this brief sentence are in Purvis’s POV, but the middle clause (“never seeing him”) is in Clarissa’s.
Woolf does this in order to give the reader an exterior view of Mrs. Dalloway. It’s simple, it’s effective, it’s unobtrusive, and it is absolutely a case of head-hopping.
The one caution I would add would be to emphasize: Don’t do this in a casual or sloppy way, or without realizing you’re doing it. Do it because it contributes to the effect you’re trying to achieve.