It was the Captain’s responsibility to teach the midshipmen and if there was a teacher, he was hired by the Captain. Same with a clergyman, the Captain was responsible for administering Church of England religious services. Both the teacher and clergyman were treated as warrants and lived with the warrants but they held no official rank.
Most Captains who did not employee a teacher pushed the teaching of the midshipmen off to the Master for math and navigation, and to one of the Lieutenants for reading and writing.
The ship’s surgeon may or may not have been a physician and held a “warrant” from the medical board but was not a Warrant Officer per se. Depending on whether he was a physician/gentlemen he was treated as either a warrant or officer.
The Purser was a warrant but was a basically civilian businessman who received no pay but contracted (for lack of a better word) to supply the ship. He put up a bond and was expected I make his money as a middleman charging typically 5% if cost for his service. Many were crooks and charged more.
The Bosun, Master, Gunner, Sail Maker, Cook and Cooper were also called standing officers because they always “stood” with the ship whether it was in service or layer up.