Can not knit RMarkdown with Python code chunk inside

I can't reproduce this issue while running your code

---
title: "Untitled"
output: html_document
date: '2022-06-05'
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(reticulate)
```

```{python}

import seaborn as sns

# Load an example dataset

tips = sns.load_dataset("tips")

# class is a pandas.core.frame.DataFrame

print(type(tips))
```

```{r}
# access with py$variable_name
tips <- py$tips
# class is a R data.frame
class(tips)
```

BTW I reformated your post - see FAQ: How to Format R Markdown Source