I once saw a sentence like this:
John, along with his friends, goes to an island.

I originally thought it should have used a singular verb instead of a plural verb. I then got the explanation that because "along with his friends" is isolated by comma so the verb only follows "John" and should thus be singular.

So, am I correct to write the following?

Tim, with his classmates, is having a meal in the canteen.

Is it true that whenever there is a phrase isolated by comma in between a singular noun and a verb, the verb directly after the isolated phrase should still be singular?

Thank you.
Your explanation is generally correct in terms of the examples you've cited.

But the comma doesn't necessarily isolate the singular noun when a conjunction is involved.
John, and several of his friends, are planning to attend the party.

You might argue that the commas are not necessary here. That's true. The phrase set off by commas is sort of an aside.
But we use the plural verb nevertheless.
Students: Are you brave enough to let our tutors analyse your pronunciation?
Then, are these two sentences the same in meaning and are correct?

John, and several of his friends, are planning to attend the party.
John, with several of his friends, is planning to attend the party.
John, along with several of his friends and his parents, are planning to attend the party. (I am really not sure about this)

Thank you
In my opinion, these are all correct.

If you did not add "and his parents" to the last one, I'd say a singular verb would be needed.