Here's the formulation of the linear program and the Gurobi code to solve it:

**Decision Variables:**

* `x1`: Investment in the chocolate company.
* `x2`: Investment in the coffee company.
* `x3`: Investment in the peanut butter company.
* `x4`: Investment in the maple syrup company.

**Objective Function:**

Maximize the total return:

```
Maximize 0.05*x1 + 0.10*x2 + 0.07*x3 + 0.06*x4
```

**Constraints:**

* **Total Investment:** The total investment cannot exceed $300,000.

```
x1 + x2 + x3 + x4 <= 300000
```

* **Chocolate Investment:** The investment in the chocolate company cannot exceed the investment in the maple syrup company.

```
x1 <= x4
```

* **Coffee Investment:** The investment in the coffee company cannot exceed the investment in the peanut butter company.

```
x2 <= x3
```

* **Maple Syrup Investment:** At most 20% of the total investment can be invested in the maple syrup company.

```
x4 <= 0.20 * 300000 
```

* **Non-negativity:** All investments must be non-negative.

```
x1, x2, x3, x4 >= 0
```

```python
import gurobipy as gp
from gurobipy import GRB

# Create a new model
m = gp.Model("Investment_Optimization")

# Create variables
x1 = m.addVar(lb=0, name="Chocolate")
x2 = m.addVar(lb=0, name="Coffee")
x3 = m.addVar(lb=0, name="Peanut_Butter")
x4 = m.addVar(lb=0, name="Maple_Syrup")

# Set objective function
m.setObjective(0.05*x1 + 0.10*x2 + 0.07*x3 + 0.06*x4, GRB.MAXIMIZE)

# Add constraints
m.addConstr(x1 + x2 + x3 + x4 <= 300000, "Total_Investment")
m.addConstr(x1 <= x4, "Chocolate_Investment")
m.addConstr(x2 <= x3, "Coffee_Investment")
m.addConstr(x4 <= 0.20 * 300000, "Maple_Syrup_Investment")

# Optimize model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print(f"Optimal return: ${m.objVal:.2f}")
    print(f"Chocolate Investment: ${x1.x:.2f}")
    print(f"Coffee Investment: ${x2.x:.2f}")
    print(f"Peanut Butter Investment: ${x3.x:.2f}")
    print(f"Maple Syrup Investment: ${x4.x:.2f}")
elif m.status == GRB.INFEASIBLE:
    print("The model is infeasible.")
else:
    print(f"Optimization terminated with status {m.status}")

```
